diff --git a/applications/tappytux/tappydrawer.pas b/applications/tappytux/tappydrawer.pas index d9e55f24f..8035c129e 100644 --- a/applications/tappytux/tappydrawer.pas +++ b/applications/tappytux/tappydrawer.pas @@ -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;