From aadb3b200b313e6ec5b2ec947887cfb59039f20b Mon Sep 17 00:00:00 2001 From: denniscuflat Date: Tue, 15 Nov 2011 20:45:41 +0000 Subject: [PATCH] git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2145 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- applications/tappytux/gameplayform.lfm | 4 ++-- applications/tappytux/mod_tappywords.pas | 20 +++++++++++++++++--- applications/tappytux/tappytux.lpi | 12 +++++++++--- applications/tappytux/tappytux.lpr | 4 ++-- 4 files changed, 30 insertions(+), 10 deletions(-) diff --git a/applications/tappytux/gameplayform.lfm b/applications/tappytux/gameplayform.lfm index 49004983e..475c1bdfe 100644 --- a/applications/tappytux/gameplayform.lfm +++ b/applications/tappytux/gameplayform.lfm @@ -1,7 +1,7 @@ object formTappyTuxGame: TformTappyTuxGame - Left = 76 + Left = 599 Height = 425 - Top = 292 + Top = 312 Width = 621 Caption = 'Tappy Tux' ClientHeight = 425 diff --git a/applications/tappytux/mod_tappywords.pas b/applications/tappytux/mod_tappywords.pas index b7c85d1db..39e51c7fe 100644 --- a/applications/tappytux/mod_tappywords.pas +++ b/applications/tappytux/mod_tappywords.pas @@ -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); diff --git a/applications/tappytux/tappytux.lpi b/applications/tappytux/tappytux.lpi index aa6173b2a..d86fc352e 100644 --- a/applications/tappytux/tappytux.lpi +++ b/applications/tappytux/tappytux.lpi @@ -30,13 +30,19 @@ - + - + - + + + + + + + diff --git a/applications/tappytux/tappytux.lpr b/applications/tappytux/tappytux.lpr index c71d5cac2..d553d7c13 100644 --- a/applications/tappytux/tappytux.lpr +++ b/applications/tappytux/tappytux.lpr @@ -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}