git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2145 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
e4e3f34376
commit
aadb3b200b
@ -1,7 +1,7 @@
|
|||||||
object formTappyTuxGame: TformTappyTuxGame
|
object formTappyTuxGame: TformTappyTuxGame
|
||||||
Left = 76
|
Left = 599
|
||||||
Height = 425
|
Height = 425
|
||||||
Top = 292
|
Top = 312
|
||||||
Width = 621
|
Width = 621
|
||||||
Caption = 'Tappy Tux'
|
Caption = 'Tappy Tux'
|
||||||
ClientHeight = 425
|
ClientHeight = 425
|
||||||
|
@ -5,7 +5,7 @@ unit mod_tappywords;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, fpSound,
|
||||||
// LCL
|
// LCL
|
||||||
ExtCtrls,
|
ExtCtrls,
|
||||||
// TappyTux
|
// TappyTux
|
||||||
@ -39,6 +39,11 @@ type
|
|||||||
procedure EndGame(); override;
|
procedure EndGame(); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
backgroundMusic: TSoundDocument;
|
||||||
|
startupSound: TSoundDocument;
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses gameplayform;
|
uses gameplayform;
|
||||||
@ -132,8 +137,8 @@ begin
|
|||||||
|
|
||||||
if QuestionList < 0 then QuestionList := 0;
|
if QuestionList < 0 then QuestionList := 0;
|
||||||
gameQuestionList := TStringList.Create;
|
gameQuestionList := TStringList.Create;
|
||||||
gameQuestionList.LoadFromFile(vTappyTuxConfig.GetResourcesDir() + 'images'+PathDelim+'modules'+PathDelim+'tappywords'+PathDelim+'0.txt');
|
//gameQuestionList.LoadFromFile(vTappyTuxConfig.GetResourcesDir() + 'images'+PathDelim+'modules'+PathDelim+'tappywords'+PathDelim+'0.txt');
|
||||||
//gameQuestionList.LoadFromFile('C:/'+IntToStr(QuestionList)+'.txt');
|
gameQuestionList.LoadFromFile('C:/'+IntToStr(QuestionList)+'.txt');
|
||||||
|
|
||||||
formTappyTuxGame.Answer.ReadOnly := false;
|
formTappyTuxGame.Answer.ReadOnly := false;
|
||||||
formTappyTuxGame.GameOver.Visible := false;
|
formTappyTuxGame.GameOver.Visible := false;
|
||||||
@ -161,12 +166,19 @@ begin
|
|||||||
lTuxAnimation.Bitmaps[5] := lTuxAnimation.Bitmaps[1];
|
lTuxAnimation.Bitmaps[5] := lTuxAnimation.Bitmaps[1];
|
||||||
vTappyTuxDrawer.AddAnimation(lTuxAnimation);
|
vTappyTuxDrawer.AddAnimation(lTuxAnimation);
|
||||||
|
|
||||||
|
//Sound Creation
|
||||||
|
//backgroundMusic := TSoundDocument.Create;
|
||||||
|
//backgroundMusic.LoadFromFile(vTappyTuxConfig.GetResourcesDir() + 'images' + PathDelim + 'music' + PathDelim + 'tux_1.png');
|
||||||
|
//startupSound := TSoundDocument.Create;
|
||||||
|
//startupSound.LoadFromFile(vTappyTuxConfig.GetResourcesDir() + 'images' + PathDelim + 'sounds' + PathDelim + 'startup.wav');
|
||||||
|
|
||||||
for i:= 1 to 5 do
|
for i:= 1 to 5 do
|
||||||
begin
|
begin
|
||||||
CreateQuestion;
|
CreateQuestion;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
startupSound.Play;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TTappyWords.CreateQuestion();
|
procedure TTappyWords.CreateQuestion();
|
||||||
@ -251,6 +263,7 @@ procedure TTappyWords.Answered;
|
|||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
j: Integer;
|
j: Integer;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
i:= 0;
|
i:= 0;
|
||||||
j:= vTappyTuxDrawer.GetAnimationCount - 1;
|
j:= vTappyTuxDrawer.GetAnimationCount - 1;
|
||||||
@ -260,6 +273,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
if (vTappyTuxDrawer.GetAnimation(i).caption = formTappyTuxGame.Answer.Text) then
|
if (vTappyTuxDrawer.GetAnimation(i).caption = formTappyTuxGame.Answer.Text) then
|
||||||
begin
|
begin
|
||||||
|
(vTappyTuxDrawer.GetAnimation(i) as TFallingText).Bitmap.LoadFromFile(vTappyTuxConfig.GetResourcesDir() + 'images' + PathDelim + 'sprites' + PathDelim + 'snowmanhit.png');
|
||||||
gameScore := gameScore +1;
|
gameScore := gameScore +1;
|
||||||
gameLevel := (gameScore div 20) + gameSLevel;
|
gameLevel := (gameScore div 20) + gameSLevel;
|
||||||
formTappyTuxGame.Score.Text := IntToStr(gameScore);
|
formTappyTuxGame.Score.Text := IntToStr(gameScore);
|
||||||
|
@ -30,13 +30,19 @@
|
|||||||
<LaunchingApplication PathPlusParams="\usr\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
|
<LaunchingApplication PathPlusParams="\usr\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
|
||||||
</local>
|
</local>
|
||||||
</RunParams>
|
</RunParams>
|
||||||
<RequiredPackages Count="2">
|
<RequiredPackages Count="4">
|
||||||
<Item1>
|
<Item1>
|
||||||
<PackageName Value="FCL"/>
|
<PackageName Value="fpsound_pkg"/>
|
||||||
</Item1>
|
</Item1>
|
||||||
<Item2>
|
<Item2>
|
||||||
<PackageName Value="LCL"/>
|
<PackageName Value="LazUtils"/>
|
||||||
</Item2>
|
</Item2>
|
||||||
|
<Item3>
|
||||||
|
<PackageName Value="FCL"/>
|
||||||
|
</Item3>
|
||||||
|
<Item4>
|
||||||
|
<PackageName Value="LCL"/>
|
||||||
|
</Item4>
|
||||||
</RequiredPackages>
|
</RequiredPackages>
|
||||||
<Units Count="9">
|
<Units Count="9">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
|
@ -7,8 +7,8 @@ uses
|
|||||||
cthreads,
|
cthreads,
|
||||||
{$ENDIF}{$ENDIF}
|
{$ENDIF}{$ENDIF}
|
||||||
Interfaces, // this includes the LCL widgetset
|
Interfaces, // this includes the LCL widgetset
|
||||||
Forms, gameconfigform, gameplayform, tappyconfig, tappydrawer,
|
Forms, gameconfigform, gameplayform, tappyconfig,
|
||||||
tappygamedata, mod_tappywords, tappymodules, mod_tappymath;
|
tappydrawer, tappygamedata, mod_tappywords, tappymodules, mod_tappymath;
|
||||||
|
|
||||||
{$R *.res}
|
{$R *.res}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user