unit pScene_Intro;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,
AdDraws, AdClasses, AdTypes, AdPerformanceCounter, AdPNG, AdVideo,
Main, pGameScene, pEasyDrawAd;
type
TScene_Intro =
class(TGameScene)
constructor Create(pMainForm:TfrmMain;pGameScreen:TAdTextureSurface;pImageList:TAdImageList);
private
{ Private-Deklarationen }
MainForm:TfrmMain;
GameScreen:TAdTextureSurface;
ImageList:TAdImageList;
EasyDraw:TEasyDrawAd;
IntroVideo:TAdVideoPlayer;
public
{ Public-Deklarationen }
procedure Draw(TimeGap:Double);
override;
procedure Run;
override;
procedure KeyPress(Key:Integer);
override;
end;
implementation
constructor TScene_Intro.Create(pMainForm:TfrmMain;pGameScreen:TAdTextureSurface;pImageList:TAdImageList);
begin
MainForm:=pMainForm;
GameScreen:=pGameScreen;
ImageList:=pImageList;
EasyDraw:=TEasyDrawAd.Create(GameScreen,ImageList);
IntroVideo:=TAdVideoPlayer.Create(GameScreen.Parent);
IntroVideo.Image.Texture.Filter:=atLinear;
IntroVideo.Open('
Video/Intro.mpg');
end;
procedure TScene_Intro.Draw(TimeGap:Double);
begin
IntroVideo.Move(TimeGap);
IntroVideo.Image.Draw(GameScreen,0,0,0);
Main.frmMain.Caption:=IntToStr(IntroVideo.CurrentFPS);
end;
procedure TScene_Intro.KeyPress(Key:Integer);
begin
if (Key=27)
OR (Key=32)
OR (Key=13)
then
begin
MainForm.ChangeGameScene(2);
end;
end;
procedure TScene_Intro.Run;
begin
IntroVideo.Play;
end;
end.