You've already forked lazarus-ccr
TappyTux is fully playable. Sound yet to be implemented.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2147 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -8,6 +8,7 @@ object formConfig: TformConfig
|
|||||||
ClientWidth = 582
|
ClientWidth = 582
|
||||||
OnClick = btnLoadClick
|
OnClick = btnLoadClick
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
|
Position = poDesktopCenter
|
||||||
LCLVersion = '0.9.31'
|
LCLVersion = '0.9.31'
|
||||||
Visible = True
|
Visible = True
|
||||||
object comboGameType: TComboBox
|
object comboGameType: TComboBox
|
||||||
@ -150,22 +151,48 @@ object formConfig: TformConfig
|
|||||||
Height = 173
|
Height = 173
|
||||||
Top = 189
|
Top = 189
|
||||||
Width = 153
|
Width = 153
|
||||||
|
Font.Height = -9
|
||||||
Lines.Strings = (
|
Lines.Strings = (
|
||||||
'Função 1:'
|
'TappyTux 3.0 (2011)'
|
||||||
' Nome 1.1'
|
|
||||||
''
|
''
|
||||||
'Função 2:'
|
'Felipe Monteiro de Carvalho'
|
||||||
' Nome 2.1'
|
'Dennis T. S. C.'
|
||||||
' Nome 2.2'
|
'Ana Claudia M. V.'
|
||||||
|
'Felipe M. K. M.'
|
||||||
|
'Guilherme Henrique S. S.'
|
||||||
''
|
''
|
||||||
'Função 3:'
|
|
||||||
' Nome 3.1'
|
|
||||||
' Nome 3.2'
|
|
||||||
' Nome 3.3'
|
|
||||||
''
|
''
|
||||||
'Função 4:'
|
'TappyTux 2.2 (2004)'
|
||||||
' Nome 4.1'
|
''
|
||||||
|
'Chief Software Architect'
|
||||||
|
' A.J. Venter'
|
||||||
|
' (aj@getopenlab.com)'
|
||||||
|
''
|
||||||
|
'Artwork'
|
||||||
|
' Silvia Hirano'
|
||||||
|
' Karl Fischer'
|
||||||
|
' A.J. Venter'
|
||||||
|
''
|
||||||
|
'Additional Artwork'
|
||||||
|
' The supertux project'
|
||||||
|
''
|
||||||
|
'Sound Effects'
|
||||||
|
' The KDE project'
|
||||||
|
''
|
||||||
|
'Music'
|
||||||
|
' DK Miller'
|
||||||
|
''
|
||||||
|
'Design & Quality Control'
|
||||||
|
' D.G. Brandjes'
|
||||||
|
''
|
||||||
|
'This program is free '
|
||||||
|
'software under the '
|
||||||
|
'GNU GPL'
|
||||||
|
'http://www.gnu.org'
|
||||||
|
''
|
||||||
)
|
)
|
||||||
|
OnChange = memoCreditsChange
|
||||||
|
ParentFont = False
|
||||||
ReadOnly = True
|
ReadOnly = True
|
||||||
ScrollBars = ssAutoVertical
|
ScrollBars = ssAutoVertical
|
||||||
TabOrder = 6
|
TabOrder = 6
|
||||||
|
@ -35,6 +35,7 @@ type
|
|||||||
procedure btnLoadClick(Sender: TObject);
|
procedure btnLoadClick(Sender: TObject);
|
||||||
procedure comboGameTypeChange(Sender: TObject);
|
procedure comboGameTypeChange(Sender: TObject);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure memoCreditsChange(Sender: TObject);
|
||||||
private
|
private
|
||||||
{ private declarations }
|
{ private declarations }
|
||||||
public
|
public
|
||||||
@ -80,6 +81,11 @@ begin
|
|||||||
GetModule(i).InitModule();
|
GetModule(i).InitModule();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TformConfig.memoCreditsChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TformConfig.TranslateUI;
|
procedure TformConfig.TranslateUI;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
|
@ -8,6 +8,7 @@ object formTappyTuxGame: TformTappyTuxGame
|
|||||||
ClientWidth = 621
|
ClientWidth = 621
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
OnShow = FormShow
|
OnShow = FormShow
|
||||||
|
Position = poDesktopCenter
|
||||||
LCLVersion = '0.9.31'
|
LCLVersion = '0.9.31'
|
||||||
object btnExit: TButton
|
object btnExit: TButton
|
||||||
Left = 8
|
Left = 8
|
||||||
@ -104,88 +105,6 @@ object formTappyTuxGame: TformTappyTuxGame
|
|||||||
ReadOnly = True
|
ReadOnly = True
|
||||||
TabOrder = 4
|
TabOrder = 4
|
||||||
end
|
end
|
||||||
object Test: TMemo
|
|
||||||
Left = 480
|
|
||||||
Height = 181
|
|
||||||
Top = 200
|
|
||||||
Width = 130
|
|
||||||
Lines.Strings = (
|
|
||||||
'cachorro'
|
|
||||||
'gato'
|
|
||||||
'peixe'
|
|
||||||
'pássaro'
|
|
||||||
'macaco'
|
|
||||||
'leão'
|
|
||||||
'tigre'
|
|
||||||
'elefante'
|
|
||||||
'crocodilo'
|
|
||||||
'abelha'
|
|
||||||
'mosca'
|
|
||||||
'água-viva'
|
|
||||||
'tartaruga'
|
|
||||||
'lagartixa'
|
|
||||||
'sapo'
|
|
||||||
'minhoca'
|
|
||||||
'centopéia'
|
|
||||||
'rinoceronte'
|
|
||||||
'coiote'
|
|
||||||
'águia'
|
|
||||||
'canguru'
|
|
||||||
'coala'
|
|
||||||
'morcego'
|
|
||||||
'gavião'
|
|
||||||
'pavão'
|
|
||||||
'cobra'
|
|
||||||
'camelo'
|
|
||||||
'lontra'
|
|
||||||
'tubarão'
|
|
||||||
'coelho'
|
|
||||||
'baleia'
|
|
||||||
'urso'
|
|
||||||
'foca'
|
|
||||||
'escorpião'
|
|
||||||
'touro'
|
|
||||||
'vaca'
|
|
||||||
'galinha'
|
|
||||||
'formiga'
|
|
||||||
'borboleta'
|
|
||||||
'girafa'
|
|
||||||
'arara'
|
|
||||||
'salamandra'
|
|
||||||
'rã'
|
|
||||||
'pinguim'
|
|
||||||
'tatu'
|
|
||||||
'avestruz'
|
|
||||||
'hiena'
|
|
||||||
'pelicano'
|
|
||||||
'pombo'
|
|
||||||
'orangotango'
|
|
||||||
'coruja'
|
|
||||||
'papagaio'
|
|
||||||
'tucano'
|
|
||||||
'ornitorrinco'
|
|
||||||
'gambá'
|
|
||||||
'rato'
|
|
||||||
'esquilo'
|
|
||||||
'golfinho'
|
|
||||||
'ovelha'
|
|
||||||
'morsa'
|
|
||||||
'suricato'
|
|
||||||
'ornitorrinco'
|
|
||||||
'toupeira'
|
|
||||||
'barata'
|
|
||||||
'lula'
|
|
||||||
'polvo'
|
|
||||||
'tamanduá'
|
|
||||||
'camarão'
|
|
||||||
'lêmure'
|
|
||||||
'besouro'
|
|
||||||
'onça'
|
|
||||||
)
|
|
||||||
OnChange = TestChange
|
|
||||||
TabOrder = 5
|
|
||||||
Visible = False
|
|
||||||
end
|
|
||||||
object GameOver: TToggleBox
|
object GameOver: TToggleBox
|
||||||
Left = 240
|
Left = 240
|
||||||
Height = 64
|
Height = 64
|
||||||
@ -196,7 +115,7 @@ object formTappyTuxGame: TformTappyTuxGame
|
|||||||
Color = clRed
|
Color = clRed
|
||||||
Enabled = False
|
Enabled = False
|
||||||
State = cbChecked
|
State = cbChecked
|
||||||
TabOrder = 6
|
TabOrder = 5
|
||||||
Visible = False
|
Visible = False
|
||||||
end
|
end
|
||||||
object Yes: TButton
|
object Yes: TButton
|
||||||
@ -207,7 +126,7 @@ object formTappyTuxGame: TformTappyTuxGame
|
|||||||
Caption = 'Yes'
|
Caption = 'Yes'
|
||||||
Color = clRed
|
Color = clRed
|
||||||
OnClick = YesClick
|
OnClick = YesClick
|
||||||
TabOrder = 7
|
TabOrder = 6
|
||||||
Visible = False
|
Visible = False
|
||||||
end
|
end
|
||||||
object No: TButton
|
object No: TButton
|
||||||
@ -218,7 +137,7 @@ object formTappyTuxGame: TformTappyTuxGame
|
|||||||
Caption = 'No'
|
Caption = 'No'
|
||||||
Color = clRed
|
Color = clRed
|
||||||
OnClick = NoClick
|
OnClick = NoClick
|
||||||
TabOrder = 8
|
TabOrder = 7
|
||||||
Visible = False
|
Visible = False
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -26,7 +26,6 @@ type
|
|||||||
LabelLevels: TLabel;
|
LabelLevels: TLabel;
|
||||||
LabelScore: TLabel;
|
LabelScore: TLabel;
|
||||||
LabelLives: TLabel;
|
LabelLives: TLabel;
|
||||||
Test: TMemo;
|
|
||||||
GameOver: TToggleBox;
|
GameOver: TToggleBox;
|
||||||
procedure btnExitClick(Sender: TObject);
|
procedure btnExitClick(Sender: TObject);
|
||||||
procedure AnswerKeyPress(Sender: TObject; var Key: char);
|
procedure AnswerKeyPress(Sender: TObject; var Key: char);
|
||||||
@ -66,7 +65,6 @@ procedure TformTappyTuxGame.AnswerKeyPress(Sender: TObject; var Key: char);
|
|||||||
begin
|
begin
|
||||||
if Key = #13 then
|
if Key = #13 then
|
||||||
begin
|
begin
|
||||||
formTappyTuxGame.Test.Lines.Add(Answer.Text);
|
|
||||||
GetCurrentModule().Answered();
|
GetCurrentModule().Answered();
|
||||||
formTappyTuxGame.Answer.Clear;
|
formTappyTuxGame.Answer.Clear;
|
||||||
|
|
||||||
|
@ -53,6 +53,8 @@ var
|
|||||||
i: Integer;
|
i: Integer;
|
||||||
j: Integer;
|
j: Integer;
|
||||||
frequency: Integer;
|
frequency: Integer;
|
||||||
|
snowmanWrong: TFallingText;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
i:= 0;
|
i:= 0;
|
||||||
j:= vTappyTuxDrawer.GetAnimationCount - 1;
|
j:= vTappyTuxDrawer.GetAnimationCount - 1;
|
||||||
@ -60,21 +62,56 @@ begin
|
|||||||
begin
|
begin
|
||||||
if vTappyTuxDrawer.GetAnimation(i).InheritsFrom(TFallingText) then
|
if vTappyTuxDrawer.GetAnimation(i).InheritsFrom(TFallingText) then
|
||||||
begin
|
begin
|
||||||
if (vTappyTuxDrawer.GetAnimation(i).Position.y >= 270) then
|
if (vTappyTuxDrawer.GetAnimation(i).Caption = 'OK!') then
|
||||||
begin
|
begin
|
||||||
|
if (vTappyTuxDrawer.GetAnimation(i).Value = '1') then
|
||||||
|
begin
|
||||||
|
vTappyTuxDrawer.RemoveAnimation(i);
|
||||||
|
i := i - 1;
|
||||||
|
end;
|
||||||
|
if (vTappyTuxDrawer.GetAnimation(i).Value = '0') then vTappyTuxDrawer.GetAnimation(i).Value := '1';
|
||||||
|
end;
|
||||||
|
if (vTappyTuxDrawer.GetAnimation(i).Caption = 'Oh-oh!') then
|
||||||
|
begin
|
||||||
|
vTappyTuxDrawer.RemoveAnimation(i);
|
||||||
gameLives := gameLives - 1;
|
gameLives := gameLives - 1;
|
||||||
formTappyTuxGame.Lives.Text := IntToStr(gameLives);
|
formTappyTuxGame.Lives.Text := IntToStr(gameLives);
|
||||||
vTappyTuxDrawer.RemoveAnimation(i);
|
CreateQuestion();
|
||||||
|
if gameLives <= 0 then EndGame();
|
||||||
i := i - 1;
|
i := i - 1;
|
||||||
if (gameLives = 0) then EndGame();
|
|
||||||
CreateQuestion;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
i := i + 1;
|
i := i + 1;
|
||||||
j := vTappyTuxDrawer.GetAnimationCount - 1;
|
j := vTappyTuxDrawer.GetAnimationCount - 1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
frequency := 30;
|
i:= 0;
|
||||||
|
j:= vTappyTuxDrawer.GetAnimationCount - 1;
|
||||||
|
while (i<= j) do
|
||||||
|
begin
|
||||||
|
if vTappyTuxDrawer.GetAnimation(i).InheritsFrom(TFallingText) then
|
||||||
|
begin
|
||||||
|
if ((vTappyTuxDrawer.GetAnimation(i).Position.y >= 270) AND (vTappyTuxDrawer.GetAnimation(i).Caption <> 'Oh-oh!')) then
|
||||||
|
begin
|
||||||
|
snowmanWrong := TFallingText.Create;
|
||||||
|
snowmanWrong.IsInfinite := False;
|
||||||
|
snowmanWrong.StartPoint := vTappyTuxDrawer.GetAnimation(i).Position;
|
||||||
|
snowmanWrong.EndPoint := vTappyTuxDrawer.GetAnimation(i).Position;
|
||||||
|
snowmanWrong.Position := vTappyTuxDrawer.GetAnimation(i).Position;
|
||||||
|
snowmanWrong.Bitmap := TPortableNetworkGraphic.Create;
|
||||||
|
snowmanWrong.caption:= 'Oh-oh!';
|
||||||
|
snowmanWrong.value:= '0';
|
||||||
|
snowmanWrong.Bitmap.LoadFromFile(vTappyTuxConfig.GetResourcesDir() + 'images' + PathDelim + 'sprites' + PathDelim + 'snowmanwrong.png');
|
||||||
|
vTappyTuxDrawer.AddAnimation(snowmanWrong);
|
||||||
|
vTappyTuxDrawer.RemoveAnimation(i);
|
||||||
|
i := i -1;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
i := i + 1;
|
||||||
|
j := vTappyTuxDrawer.GetAnimationCount - 1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
frequency := 60;
|
||||||
count := count + 1;
|
count := count + 1;
|
||||||
if count >= frequency then
|
if count >= frequency then
|
||||||
begin
|
begin
|
||||||
@ -123,6 +160,7 @@ var
|
|||||||
begin
|
begin
|
||||||
count := 0;
|
count := 0;
|
||||||
timerMath.Enabled := True;
|
timerMath.Enabled := True;
|
||||||
|
timerMath.Interval:= 500;
|
||||||
gameScore := 0;
|
gameScore := 0;
|
||||||
gameLives := 5;
|
gameLives := 5;
|
||||||
gameLevel := Level+1;
|
gameLevel := Level+1;
|
||||||
@ -188,7 +226,6 @@ begin
|
|||||||
yAux:=5;
|
yAux:=5;
|
||||||
|
|
||||||
snowmanAnimation := TFallingText.Create;
|
snowmanAnimation := TFallingText.Create;
|
||||||
snowmanAnimation.IsInfinite := False;
|
|
||||||
|
|
||||||
|
|
||||||
for i:= 0 to vTappyTuxDrawer.GetAnimationCount - 1 do
|
for i:= 0 to vTappyTuxDrawer.GetAnimationCount - 1 do
|
||||||
@ -235,7 +272,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
snowmanAnimation.StartPoint := Point(xAux, 5);
|
snowmanAnimation.StartPoint := Point(xAux, 5);
|
||||||
snowmanAnimation.EndPoint := Point(xAux, 205);
|
snowmanAnimation.EndPoint := Point(xAux, 100);
|
||||||
snowmanAnimation.IsInfinite:= false;
|
snowmanAnimation.IsInfinite:= false;
|
||||||
snowmanAnimation.Bitmap := TPortableNetworkGraphic.Create;
|
snowmanAnimation.Bitmap := TPortableNetworkGraphic.Create;
|
||||||
//snowmanAnimation.caption:= gameQuestionList[random(gameQuestionList.Count - 1)];
|
//snowmanAnimation.caption:= gameQuestionList[random(gameQuestionList.Count - 1)];
|
||||||
@ -275,6 +312,8 @@ procedure TTappyMath.Answered;
|
|||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
j: Integer;
|
j: Integer;
|
||||||
|
snowmanRight: TFallingText;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
i:= 0;
|
i:= 0;
|
||||||
j:= vTappyTuxDrawer.GetAnimationCount - 1;
|
j:= vTappyTuxDrawer.GetAnimationCount - 1;
|
||||||
@ -288,6 +327,16 @@ begin
|
|||||||
gameLevel := (gameScore div 20) + gameSLevel;
|
gameLevel := (gameScore div 20) + gameSLevel;
|
||||||
formTappyTuxGame.Score.Text := IntToStr(gameScore);
|
formTappyTuxGame.Score.Text := IntToStr(gameScore);
|
||||||
formTappyTuxGame.Level.Text := IntToStr(gameLevel);
|
formTappyTuxGame.Level.Text := IntToStr(gameLevel);
|
||||||
|
snowmanRight := TFallingText.Create;
|
||||||
|
snowmanRight.IsInfinite := False;
|
||||||
|
snowmanRight.StartPoint := vTappyTuxDrawer.GetAnimation(i).Position;
|
||||||
|
snowmanRight.EndPoint := vTappyTuxDrawer.GetAnimation(i).Position;
|
||||||
|
snowmanRight.Position := vTappyTuxDrawer.GetAnimation(i).Position;
|
||||||
|
snowmanRight.Bitmap := TPortableNetworkGraphic.Create;
|
||||||
|
snowmanRight.caption:= 'OK!';
|
||||||
|
snowmanRight.value:= '0';
|
||||||
|
snowmanRight.Bitmap.LoadFromFile(vTappyTuxConfig.GetResourcesDir() + 'images' + PathDelim + 'sprites' + PathDelim + 'snowmanright.png');
|
||||||
|
vTappyTuxDrawer.AddAnimation(snowmanRight);
|
||||||
vTappyTuxDrawer.RemoveAnimation(i);
|
vTappyTuxDrawer.RemoveAnimation(i);
|
||||||
i := i - 1;
|
i := i - 1;
|
||||||
CreateQuestion;
|
CreateQuestion;
|
||||||
|
@ -55,6 +55,7 @@ var
|
|||||||
i: Integer;
|
i: Integer;
|
||||||
j: Integer;
|
j: Integer;
|
||||||
frequency: Integer;
|
frequency: Integer;
|
||||||
|
snowmanWrong: TFallingText;
|
||||||
begin
|
begin
|
||||||
i:= 0;
|
i:= 0;
|
||||||
j:= vTappyTuxDrawer.GetAnimationCount - 1;
|
j:= vTappyTuxDrawer.GetAnimationCount - 1;
|
||||||
@ -62,21 +63,56 @@ begin
|
|||||||
begin
|
begin
|
||||||
if vTappyTuxDrawer.GetAnimation(i).InheritsFrom(TFallingText) then
|
if vTappyTuxDrawer.GetAnimation(i).InheritsFrom(TFallingText) then
|
||||||
begin
|
begin
|
||||||
if (vTappyTuxDrawer.GetAnimation(i).Position.y >= 270) then
|
if (vTappyTuxDrawer.GetAnimation(i).Caption = 'OK!') then
|
||||||
begin
|
begin
|
||||||
|
if (vTappyTuxDrawer.GetAnimation(i).Value = '1') then
|
||||||
|
begin
|
||||||
|
vTappyTuxDrawer.RemoveAnimation(i);
|
||||||
|
i := i - 1;
|
||||||
|
end;
|
||||||
|
if (vTappyTuxDrawer.GetAnimation(i).Value = '0') then vTappyTuxDrawer.GetAnimation(i).Value := '1';
|
||||||
|
end;
|
||||||
|
if (vTappyTuxDrawer.GetAnimation(i).Caption = 'Oh-oh!') then
|
||||||
|
begin
|
||||||
|
vTappyTuxDrawer.RemoveAnimation(i);
|
||||||
gameLives := gameLives - 1;
|
gameLives := gameLives - 1;
|
||||||
formTappyTuxGame.Lives.Text := IntToStr(gameLives);
|
formTappyTuxGame.Lives.Text := IntToStr(gameLives);
|
||||||
vTappyTuxDrawer.RemoveAnimation(i);
|
CreateQuestion();
|
||||||
|
if gameLives <= 0 then EndGame();
|
||||||
i := i - 1;
|
i := i - 1;
|
||||||
if (gameLives = 0) then EndGame();
|
|
||||||
CreateQuestion;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
i := i + 1;
|
i := i + 1;
|
||||||
j := vTappyTuxDrawer.GetAnimationCount - 1;
|
j := vTappyTuxDrawer.GetAnimationCount - 1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
frequency := 30;
|
i:= 0;
|
||||||
|
j:= vTappyTuxDrawer.GetAnimationCount - 1;
|
||||||
|
while (i<= j) do
|
||||||
|
begin
|
||||||
|
if vTappyTuxDrawer.GetAnimation(i).InheritsFrom(TFallingText) then
|
||||||
|
begin
|
||||||
|
if ((vTappyTuxDrawer.GetAnimation(i).Position.y >= 270) AND (vTappyTuxDrawer.GetAnimation(i).Caption <> 'Oh-oh!')) then
|
||||||
|
begin
|
||||||
|
snowmanWrong := TFallingText.Create;
|
||||||
|
snowmanWrong.IsInfinite := False;
|
||||||
|
snowmanWrong.StartPoint := vTappyTuxDrawer.GetAnimation(i).Position;
|
||||||
|
snowmanWrong.EndPoint := vTappyTuxDrawer.GetAnimation(i).Position;
|
||||||
|
snowmanWrong.Position := vTappyTuxDrawer.GetAnimation(i).Position;
|
||||||
|
snowmanWrong.Bitmap := TPortableNetworkGraphic.Create;
|
||||||
|
snowmanWrong.caption:= 'Oh-oh!';
|
||||||
|
snowmanWrong.value:= '0';
|
||||||
|
snowmanWrong.Bitmap.LoadFromFile(vTappyTuxConfig.GetResourcesDir() + 'images' + PathDelim + 'sprites' + PathDelim + 'snowmanwrong.png');
|
||||||
|
vTappyTuxDrawer.AddAnimation(snowmanWrong);
|
||||||
|
vTappyTuxDrawer.RemoveAnimation(i);
|
||||||
|
i := i -1;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
i := i + 1;
|
||||||
|
j := vTappyTuxDrawer.GetAnimationCount - 1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
frequency := 60;
|
||||||
count := count + 1;
|
count := count + 1;
|
||||||
if count >= frequency then
|
if count >= frequency then
|
||||||
begin
|
begin
|
||||||
@ -125,6 +161,7 @@ var
|
|||||||
begin
|
begin
|
||||||
count := 5;
|
count := 5;
|
||||||
timerWords.Enabled := True;
|
timerWords.Enabled := True;
|
||||||
|
timerWords.Interval:= 500;
|
||||||
gameScore := 0;
|
gameScore := 0;
|
||||||
gameLives := 5;
|
gameLives := 5;
|
||||||
gameLevel := Level+1;
|
gameLevel := Level+1;
|
||||||
@ -203,7 +240,6 @@ begin
|
|||||||
yAux:=5;
|
yAux:=5;
|
||||||
|
|
||||||
snowmanAnimation := TFallingText.Create;
|
snowmanAnimation := TFallingText.Create;
|
||||||
snowmanAnimation.IsInfinite := False;
|
|
||||||
|
|
||||||
|
|
||||||
for i:= 0 to vTappyTuxDrawer.GetAnimationCount - 1 do
|
for i:= 0 to vTappyTuxDrawer.GetAnimationCount - 1 do
|
||||||
@ -250,7 +286,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
snowmanAnimation.StartPoint := Point(xAux, 5);
|
snowmanAnimation.StartPoint := Point(xAux, 5);
|
||||||
snowmanAnimation.EndPoint := Point(xAux, 205);
|
snowmanAnimation.EndPoint := Point(xAux, 100);
|
||||||
snowmanAnimation.IsInfinite:= false;
|
snowmanAnimation.IsInfinite:= false;
|
||||||
snowmanAnimation.Bitmap := TPortableNetworkGraphic.Create;
|
snowmanAnimation.Bitmap := TPortableNetworkGraphic.Create;
|
||||||
snowmanAnimation.caption:= gameQuestionList[random(gameQuestionList.Count - 1)];
|
snowmanAnimation.caption:= gameQuestionList[random(gameQuestionList.Count - 1)];
|
||||||
@ -263,6 +299,7 @@ procedure TTappyWords.Answered;
|
|||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
j: Integer;
|
j: Integer;
|
||||||
|
snowmanRight: TFallingText;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
i:= 0;
|
i:= 0;
|
||||||
@ -273,11 +310,20 @@ 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);
|
||||||
formTappyTuxGame.Level.Text := IntToStr(gameLevel);
|
formTappyTuxGame.Level.Text := IntToStr(gameLevel);
|
||||||
|
snowmanRight := TFallingText.Create;
|
||||||
|
snowmanRight.IsInfinite := False;
|
||||||
|
snowmanRight.StartPoint := vTappyTuxDrawer.GetAnimation(i).Position;
|
||||||
|
snowmanRight.EndPoint := vTappyTuxDrawer.GetAnimation(i).Position;
|
||||||
|
snowmanRight.Position := vTappyTuxDrawer.GetAnimation(i).Position;
|
||||||
|
snowmanRight.Bitmap := TPortableNetworkGraphic.Create;
|
||||||
|
snowmanRight.caption:= 'OK!';
|
||||||
|
snowmanRight.value:= '0';
|
||||||
|
snowmanRight.Bitmap.LoadFromFile(vTappyTuxConfig.GetResourcesDir() + 'images' + PathDelim + 'sprites' + PathDelim + 'snowmanright.png');
|
||||||
|
vTappyTuxDrawer.AddAnimation(snowmanRight);
|
||||||
vTappyTuxDrawer.RemoveAnimation(i);
|
vTappyTuxDrawer.RemoveAnimation(i);
|
||||||
i := i - 1;
|
i := i - 1;
|
||||||
end;
|
end;
|
||||||
|
Reference in New Issue
Block a user