Einzelnen Beitrag anzeigen

Benutzerbild von Die Muhkuh
Die Muhkuh

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

Re: [DelphiX] Relative Figur-Bewegung

  Alt 30. Apr 2006, 17:23
Moinchen,

Delphi-Quellcode:
procedure TAuto.DoMove(MoveCount: Integer);
begin
  inherited DoMove(MoveCount);

  if isUp in Form1.Input.States then
  begin
    X := X + cos256(Angle) * (MoveCount);
    Y := Y + sin256(Angle) * (MoveCount);
  end;

  if isDown in Form1.Input.States then
  begin
    X := X - cos256(Angle) * MoveCount;
    Y := Y - sin256(Angle) * MoveCount;
  end;

  if isLeft in Form1.Input.States then
    Angle := Angle - 1;

  if isRight in Form1.Input.States then
    Angle := Angle + 1;
end;
(Auszug aus meinem Source)
  Mit Zitat antworten Zitat