git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2145 8e941d3f-bd1b-0410-a28a-d453659cc2b4

This commit is contained in:
denniscuflat 2011-11-15 20:45:41 +00:00
parent e4e3f34376
commit aadb3b200b
4 changed files with 30 additions and 10 deletions

View File

@ -1,7 +1,7 @@
object formTappyTuxGame: TformTappyTuxGame
Left = 76
Left = 599
Height = 425
Top = 292
Top = 312
Width = 621
Caption = 'Tappy Tux'
ClientHeight = 425

View File

@ -5,7 +5,7 @@ unit mod_tappywords;
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, fpSound,
// LCL
ExtCtrls,
// TappyTux
@ -39,6 +39,11 @@ type
procedure EndGame(); override;
end;
var
backgroundMusic: TSoundDocument;
startupSound: TSoundDocument;
implementation
uses gameplayform;
@ -132,8 +137,8 @@ begin
if QuestionList < 0 then QuestionList := 0;
gameQuestionList := TStringList.Create;
gameQuestionList.LoadFromFile(vTappyTuxConfig.GetResourcesDir() + 'images'+PathDelim+'modules'+PathDelim+'tappywords'+PathDelim+'0.txt');
//gameQuestionList.LoadFromFile('C:/'+IntToStr(QuestionList)+'.txt');
//gameQuestionList.LoadFromFile(vTappyTuxConfig.GetResourcesDir() + 'images'+PathDelim+'modules'+PathDelim+'tappywords'+PathDelim+'0.txt');
gameQuestionList.LoadFromFile('C:/'+IntToStr(QuestionList)+'.txt');
formTappyTuxGame.Answer.ReadOnly := false;
formTappyTuxGame.GameOver.Visible := false;
@ -161,12 +166,19 @@ begin
lTuxAnimation.Bitmaps[5] := lTuxAnimation.Bitmaps[1];
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
begin
CreateQuestion;
end;
startupSound.Play;
end;
procedure TTappyWords.CreateQuestion();
@ -251,6 +263,7 @@ procedure TTappyWords.Answered;
var
i: Integer;
j: Integer;
begin
i:= 0;
j:= vTappyTuxDrawer.GetAnimationCount - 1;
@ -260,6 +273,7 @@ begin
begin
if (vTappyTuxDrawer.GetAnimation(i).caption = formTappyTuxGame.Answer.Text) then
begin
(vTappyTuxDrawer.GetAnimation(i) as TFallingText).Bitmap.LoadFromFile(vTappyTuxConfig.GetResourcesDir() + 'images' + PathDelim + 'sprites' + PathDelim + 'snowmanhit.png');
gameScore := gameScore +1;
gameLevel := (gameScore div 20) + gameSLevel;
formTappyTuxGame.Score.Text := IntToStr(gameScore);

View File

@ -30,13 +30,19 @@
<LaunchingApplication PathPlusParams="\usr\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<RequiredPackages Count="4">
<Item1>
<PackageName Value="FCL"/>
<PackageName Value="fpsound_pkg"/>
</Item1>
<Item2>
<PackageName Value="LCL"/>
<PackageName Value="LazUtils"/>
</Item2>
<Item3>
<PackageName Value="FCL"/>
</Item3>
<Item4>
<PackageName Value="LCL"/>
</Item4>
</RequiredPackages>
<Units Count="9">
<Unit0>

View File

@ -7,8 +7,8 @@ uses
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, gameconfigform, gameplayform, tappyconfig, tappydrawer,
tappygamedata, mod_tappywords, tappymodules, mod_tappymath;
Forms, gameconfigform, gameplayform, tappyconfig,
tappydrawer, tappygamedata, mod_tappywords, tappymodules, mod_tappymath;
{$R *.res}