You've already forked lazarus-ccr
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2137 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -70,6 +70,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
for i:= 0 to vTappyTuxDrawer.GetAnimationCount - 1 do
|
||||||
|
begin
|
||||||
|
if vTappyTuxDrawer.GetAnimation(i).InheritsFrom(TFallingText) then
|
||||||
|
begin
|
||||||
|
vTappyTuxDrawer.GetAnimation(i).StartPoint.y:= vTappyTuxDrawer.GetAnimation(i).StartPoint.y + (5*gameLevel);
|
||||||
|
vTappyTuxDrawer.GetAnimation(i).EndPoint.y:= vTappyTuxDrawer.GetAnimation(i).StartPoint.y;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
vTappyTuxDrawer.HandleAnimationOnTimer();
|
vTappyTuxDrawer.HandleAnimationOnTimer();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -106,6 +117,7 @@ procedure TTappyWords.StartNewGame(SndFX: Integer; Music: Integer; Level: Intege
|
|||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
lTuxAnimation: TTappySpriteAnimation;
|
lTuxAnimation: TTappySpriteAnimation;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
timerWords.Enabled := True;
|
timerWords.Enabled := True;
|
||||||
gameScore := 0;
|
gameScore := 0;
|
||||||
@ -118,10 +130,11 @@ begin
|
|||||||
if (Music = 1) then gameMusic := false;
|
if (Music = 1) then gameMusic := false;
|
||||||
gameSLevel := gameLevel;
|
gameSLevel := gameLevel;
|
||||||
|
|
||||||
|
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:/Users/User/Lazarus/Arquivos/Repositorio/applications/tappytux/images/modules/tappywords/0.txt');
|
//gameQuestionList.LoadFromFile('C:/Users/User/Lazarus/Arquivos/Repositorio/applications/tappytux/images/modules/tappywords/0.txt');
|
||||||
//gameQuestionList.LoadFromFile('C:/0.txt');
|
gameQuestionList.LoadFromFile('C:/'+IntToStr(QuestionList)+'.txt');
|
||||||
|
|
||||||
formTappyTuxGame.Answer.ReadOnly := false;
|
formTappyTuxGame.Answer.ReadOnly := false;
|
||||||
formTappyTuxGame.GameOver.Visible := false;
|
formTappyTuxGame.GameOver.Visible := false;
|
||||||
@ -133,14 +146,14 @@ begin
|
|||||||
|
|
||||||
for i:= 1 to 5 do
|
for i:= 1 to 5 do
|
||||||
begin
|
begin
|
||||||
Questions[i].Text := formTappyTuxGame.Test.Lines.Strings[random(71)];
|
//Questions[i].Text := formTappyTuxGame.Test.Lines.Strings[random(71)];
|
||||||
//Questions[i].Text := gameQuestionList[random(gameQuestionList.Count - 1)];
|
Questions[i].Text := gameQuestionList[random(gameQuestionList.Count - 1)];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Animations Creation
|
// Animations Creation
|
||||||
lTuxAnimation := TTappySpriteAnimation.Create;
|
lTuxAnimation := TTappySpriteAnimation.Create;
|
||||||
lTuxAnimation.IsInfinite := True;
|
lTuxAnimation.IsInfinite := True;
|
||||||
lTuxAnimation.StartPoint := Point(250, 300);
|
lTuxAnimation.StartPoint := Point(250, 328);
|
||||||
lTuxAnimation.EndPoint := lTuxAnimation.StartPoint;
|
lTuxAnimation.EndPoint := lTuxAnimation.StartPoint;
|
||||||
SetLength(lTuxAnimation.Bitmaps, 6);
|
SetLength(lTuxAnimation.Bitmaps, 6);
|
||||||
lTuxAnimation.Bitmaps[0] := TPortableNetworkGraphic.Create;
|
lTuxAnimation.Bitmaps[0] := TPortableNetworkGraphic.Create;
|
||||||
@ -181,6 +194,8 @@ begin
|
|||||||
snowmanAnimation := TFallingText.Create;
|
snowmanAnimation := TFallingText.Create;
|
||||||
snowmanAnimation.IsInfinite := True;
|
snowmanAnimation.IsInfinite := True;
|
||||||
|
|
||||||
|
if True then
|
||||||
|
begin
|
||||||
for i:= 0 to vTappyTuxDrawer.GetAnimationCount - 1 do
|
for i:= 0 to vTappyTuxDrawer.GetAnimationCount - 1 do
|
||||||
begin
|
begin
|
||||||
if vTappyTuxDrawer.GetAnimation(i).InheritsFrom(TFallingText) then
|
if vTappyTuxDrawer.GetAnimation(i).InheritsFrom(TFallingText) then
|
||||||
@ -197,6 +212,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
if existenceAux1 = false then xAux := 5
|
if existenceAux1 = false then xAux := 5
|
||||||
else
|
else
|
||||||
@ -219,6 +235,7 @@ begin
|
|||||||
snowmanAnimation.StartPoint := Point(xAux, 5);
|
snowmanAnimation.StartPoint := Point(xAux, 5);
|
||||||
snowmanAnimation.EndPoint := snowmanAnimation.StartPoint;
|
snowmanAnimation.EndPoint := snowmanAnimation.StartPoint;
|
||||||
snowmanAnimation.Bitmap := TPortableNetworkGraphic.Create;
|
snowmanAnimation.Bitmap := TPortableNetworkGraphic.Create;
|
||||||
|
snowmanAnimation.QuestionText:= formTappyTuxGame.Test.Lines.Strings[random(71)];
|
||||||
snowmanAnimation.Bitmap.LoadFromFile(vTappyTuxConfig.GetResourcesDir() + 'images' + PathDelim + 'sprites' + PathDelim + 'snowman.png');
|
snowmanAnimation.Bitmap.LoadFromFile(vTappyTuxConfig.GetResourcesDir() + 'images' + PathDelim + 'sprites' + PathDelim + 'snowman.png');
|
||||||
vTappyTuxDrawer.AddAnimation(snowmanAnimation);
|
vTappyTuxDrawer.AddAnimation(snowmanAnimation);
|
||||||
|
|
||||||
@ -233,7 +250,8 @@ begin
|
|||||||
if (formTappyTuxGame.Answer.Text = Questions[i].Text) then
|
if (formTappyTuxGame.Answer.Text = Questions[i].Text) then
|
||||||
begin
|
begin
|
||||||
Questions[i].Top := 24;
|
Questions[i].Top := 24;
|
||||||
Questions[i].Text := formTappyTuxGame.Test.Lines.Strings[random(71)];
|
//Questions[i].Text := formTappyTuxGame.Test.Lines.Strings[random(71)];
|
||||||
|
Questions[i].Text := gameQuestionList[random(gameQuestionList.Count - 1)];
|
||||||
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);
|
||||||
@ -245,6 +263,7 @@ end;
|
|||||||
|
|
||||||
procedure TTappyWords.EndGame;
|
procedure TTappyWords.EndGame;
|
||||||
var
|
var
|
||||||
|
i : Integer;
|
||||||
gameOverScreen: TTappySpriteAnimation;
|
gameOverScreen: TTappySpriteAnimation;
|
||||||
continueBtn: TButton;
|
continueBtn: TButton;
|
||||||
exitBtn: TButton;
|
exitBtn: TButton;
|
||||||
@ -261,6 +280,11 @@ begin
|
|||||||
//gameOverScreen.Bitmaps[0].LoadFromFile(vTappyTuxConfig.GetResourcesDir() + 'images' + PathDelim + 'sprites' + PathDelim + 'gameover.png');
|
//gameOverScreen.Bitmaps[0].LoadFromFile(vTappyTuxConfig.GetResourcesDir() + 'images' + PathDelim + 'sprites' + PathDelim + 'gameover.png');
|
||||||
//vTappyTuxDrawer.AddAnimation(gameOverScreen);
|
//vTappyTuxDrawer.AddAnimation(gameOverScreen);
|
||||||
|
|
||||||
|
for i:= 1 to vTappyTuxDrawer.GetAnimationCount - 1 do
|
||||||
|
begin
|
||||||
|
vTappyTuxDrawer.GetAnimation(i).Destroy;
|
||||||
|
end;
|
||||||
|
|
||||||
formTappyTuxGame.GameOver.Visible := true;
|
formTappyTuxGame.GameOver.Visible := true;
|
||||||
formTappyTuxGame.Yes.Visible := true;
|
formTappyTuxGame.Yes.Visible := true;
|
||||||
formTappyTuxGame.No.Visible := true;
|
formTappyTuxGame.No.Visible := true;
|
||||||
|
@ -7,7 +7,7 @@ interface
|
|||||||
uses
|
uses
|
||||||
Classes, SysUtils, Controls, Graphics, LCLType, IntfGraphics, fpimage,
|
Classes, SysUtils, Controls, Graphics, LCLType, IntfGraphics, fpimage,
|
||||||
Math,
|
Math,
|
||||||
{tappygamedata,} tappyconfig, tappymodules;
|
tappyconfig, tappymodules;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -48,7 +48,8 @@ type
|
|||||||
public
|
public
|
||||||
//StartPoint, EndPoint: TPoint; override;
|
//StartPoint, EndPoint: TPoint; override;
|
||||||
Bitmap: TFPImageBitmap;
|
Bitmap: TFPImageBitmap;
|
||||||
Question: TCanvas;
|
QuestionText: String;
|
||||||
|
QuestionBox: TCanvas;
|
||||||
procedure DrawToIntfImg(AIntfImage: TLazIntfImage); override;
|
procedure DrawToIntfImg(AIntfImage: TLazIntfImage); override;
|
||||||
procedure ExecuteFinal; override;
|
procedure ExecuteFinal; override;
|
||||||
end;
|
end;
|
||||||
@ -146,6 +147,8 @@ begin
|
|||||||
|
|
||||||
TTappyTuxDrawer.DrawImageWithTransparentColor(AIntfImage,
|
TTappyTuxDrawer.DrawImageWithTransparentColor(AIntfImage,
|
||||||
lPos.X, lPos.Y, colFuchsia, Bitmap);
|
lPos.X, lPos.Y, colFuchsia, Bitmap);
|
||||||
|
QuestionBox := TCanvas.Create;
|
||||||
|
QuestionBox.TextOut(lPos.X, lPos.Y, QuestionText);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFallingText.ExecuteFinal;
|
procedure TFallingText.ExecuteFinal;
|
||||||
@ -365,8 +368,6 @@ begin
|
|||||||
begin
|
begin
|
||||||
lAnimation := TTappyTuxAnimation(FAnimationList.Items[i]);
|
lAnimation := TTappyTuxAnimation(FAnimationList.Items[i]);
|
||||||
Inc(lAnimation.CurrentStep);
|
Inc(lAnimation.CurrentStep);
|
||||||
|
|
||||||
if lAnimation.InheritsFrom(TFallingText) then lAnimation.StartPoint.y := lAnimation.StartPoint.y + 10;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Self.Invalidate;
|
Self.Invalidate;
|
||||||
|
Reference in New Issue
Block a user