You've already forked lazarus-ccr
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:
@ -34,15 +34,6 @@ type
|
|||||||
procedure ExecuteFinal; override;
|
procedure ExecuteFinal; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TBallonAnimation
|
|
||||||
|
|
||||||
TBallonAnimation = class(TTappyTuxAnimation)
|
|
||||||
public
|
|
||||||
constructor Create; override;
|
|
||||||
procedure DrawToCanvas(ACanvas: TCanvas); override;
|
|
||||||
procedure ExecuteFinal; override;
|
|
||||||
end;}
|
|
||||||
|
|
||||||
{ TFallingText }
|
{ TFallingText }
|
||||||
TFallingText = class(TTappyTuxAnimation)
|
TFallingText = class(TTappyTuxAnimation)
|
||||||
public
|
public
|
||||||
@ -77,9 +68,10 @@ type
|
|||||||
procedure HandleMouseDown(Sender: TObject; Button: TMouseButton;
|
procedure HandleMouseDown(Sender: TObject; Button: TMouseButton;
|
||||||
Shift: TShiftState; X, Y: Integer);
|
Shift: TShiftState; X, Y: Integer);
|
||||||
procedure HandleOnTimer(Sender: TObject);
|
procedure HandleOnTimer(Sender: TObject);
|
||||||
procedure AddAnimation(AAnimation: TTappyTuxAnimation);
|
function AddAnimation(AAnimation: TTappyTuxAnimation): Integer;
|
||||||
function GetAnimation(AIndex: Integer): TTappyTuxAnimation;
|
function GetAnimation(AIndex: Integer): TTappyTuxAnimation;
|
||||||
function GetAnimationCount: Integer;
|
function GetAnimationCount: Integer;
|
||||||
|
procedure RemoveAnimation(AIndex: Integer);
|
||||||
procedure HandleAnimationOnTimer();
|
procedure HandleAnimationOnTimer();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -88,26 +80,6 @@ var
|
|||||||
|
|
||||||
implementation
|
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 }
|
{ TTappySpriteAnimation }
|
||||||
|
|
||||||
procedure TTappySpriteAnimation.DrawToIntfImg(AIntfImage: TLazIntfImage);
|
procedure TTappySpriteAnimation.DrawToIntfImg(AIntfImage: TLazIntfImage);
|
||||||
@ -350,9 +322,9 @@ begin
|
|||||||
end;}
|
end;}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TTappyTuxDrawer.AddAnimation(AAnimation: TTappyTuxAnimation);
|
function TTappyTuxDrawer.AddAnimation(AAnimation: TTappyTuxAnimation): Integer;
|
||||||
begin
|
begin
|
||||||
FAnimationList.Add(AAnimation);
|
Result := FAnimationList.Add(AAnimation);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TTappyTuxDrawer.GetAnimation(AIndex: Integer): TTappyTuxAnimation;
|
function TTappyTuxDrawer.GetAnimation(AIndex: Integer): TTappyTuxAnimation;
|
||||||
@ -365,6 +337,11 @@ begin
|
|||||||
Result := FAnimationList.Count;
|
Result := FAnimationList.Count;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TTappyTuxDrawer.RemoveAnimation(AIndex: Integer);
|
||||||
|
begin
|
||||||
|
FAnimationList.Delete(AIndex);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TTappyTuxDrawer.HandleAnimationOnTimer;
|
procedure TTappyTuxDrawer.HandleAnimationOnTimer;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
|
Reference in New Issue
Block a user