AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Multimedia Delphi Animation wird nicht richtig abgespielt mit DelphiX
Thema durchsuchen
Ansicht
Themen-Optionen

Animation wird nicht richtig abgespielt mit DelphiX

Ein Thema von theCOW · begonnen am 23. Jan 2005 · letzter Beitrag vom 23. Jan 2005
Antwort Antwort
Benutzerbild von Die Muhkuh
Die Muhkuh

Registriert seit: 21. Aug 2003
7.332 Beiträge
 
Delphi 2009 Professional
 
#1

Re: Animation wird nicht richtig abgespielt mit DelphiX

  Alt 23. Jan 2005, 13:28
Hi,

24/100? Nenene du, das müssen 24/1000 sein. Nciht 24/100. Deswegen klappte das bei mir auch. Ich hab da aus reflex 24/1000 hingeschrieben. Änders mal (auch bei der Explosion)

Delphi-Quellcode:
constructor TAnimation.Create(AParent: TSprite);
begin
  inherited Create(AParent);
  Image := Form1.DXImageList1.Items.Find('1');
  Width := Image.Width;
  Height := Image.Height;
  Visible := true;

  AnimCount := 4;
  AnimLooped := true;
  AnimSPeed := 24/1000; //<--
  AnimStart := 0;
end;

procedure TAnimation.DoMove(MoveCount: integer);
begin

  inherited DoMove(MoveCount);
  if FMove = true then
  begin

    if (IsUp in Form1.DXInput1.States) and (Y >= 0) then
      Y := Y-vY;
    if (IsDown in Form1.DXInput1.States) and (Y+Height <= Form1.DXDraw1.Height) then
      Y := Y+vY;
    if (IsLeft in Form1.DXInput1.States) and (X >= 0) then
      X := X-vX;
    if (ISRight in Form1.DXInput1.States) and (X+Width <= Form1.DXDraw1.Width) then
      X := X+vX;

    Collision;
  end
  else
    if FCollision then
    begin
      if AnimPos = 3 then
        Dead;
    end;
end;

procedure TAnimation.DoCollision(Sprite: TSprite; var Done: boolean);
begin
  if not FCollision then
  begin
    if Sprite is TStone then
    begin
      FCollision := true;
      FMove := false;

      Image := Form1.DXImageList1.Items.Find('Explosion');
      Width := Image.Width;
      Height := Image.Height;
      AnimCount := Image.PatternCount;
      AnimSpeed := 12/1000; //<--
      AnimLooped := false;
      AnimStart := 0;
      Form1.DXWaveList1.Items.Find('Explosion').Play(false);
    end;
  end;
end;
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:57 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz