tappytux: Cleanup and adds animation destruction code

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2139 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
sekelsenmat
2011-11-15 14:03:57 +00:00
parent 900023506f
commit cbad3f56f8

View File

@ -34,15 +34,6 @@ type
procedure ExecuteFinal; override;
end;
{ TBallonAnimation
TBallonAnimation = class(TTappyTuxAnimation)
public
constructor Create; override;
procedure DrawToCanvas(ACanvas: TCanvas); override;
procedure ExecuteFinal; override;
end;}
{ TFallingText }
TFallingText = class(TTappyTuxAnimation)
public
@ -77,9 +68,10 @@ type
procedure HandleMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure HandleOnTimer(Sender: TObject);
procedure AddAnimation(AAnimation: TTappyTuxAnimation);
function AddAnimation(AAnimation: TTappyTuxAnimation): Integer;
function GetAnimation(AIndex: Integer): TTappyTuxAnimation;
function GetAnimationCount: Integer;
procedure RemoveAnimation(AIndex: Integer);
procedure HandleAnimationOnTimer();
end;
@ -88,26 +80,6 @@ var
implementation
{ TBallonAnimation
constructor TBallonAnimation.Create;
begin
inherited Create;
CurrentStep := 0;
StepCount := 200;
end;
procedure TBallonAnimation.DrawToCanvas(ACanvas: TCanvas);
begin
ACanvas.Pixels[CurrentStep, CurrentStep] := clRed;
end;
procedure TBallonAnimation.ExecuteFinal;
begin
// Lost the game if the ballon reached its end
end}
{ TTappySpriteAnimation }
procedure TTappySpriteAnimation.DrawToIntfImg(AIntfImage: TLazIntfImage);
@ -350,9 +322,9 @@ begin
end;}
end;
procedure TTappyTuxDrawer.AddAnimation(AAnimation: TTappyTuxAnimation);
function TTappyTuxDrawer.AddAnimation(AAnimation: TTappyTuxAnimation): Integer;
begin
FAnimationList.Add(AAnimation);
Result := FAnimationList.Add(AAnimation);
end;
function TTappyTuxDrawer.GetAnimation(AIndex: Integer): TTappyTuxAnimation;
@ -365,6 +337,11 @@ begin
Result := FAnimationList.Count;
end;
procedure TTappyTuxDrawer.RemoveAnimation(AIndex: Integer);
begin
FAnimationList.Delete(AIndex);
end;
procedure TTappyTuxDrawer.HandleAnimationOnTimer;
var
i: Integer;