*g* Luckie wie alle ihn kennen
da es ja die Auslastung dauernd 100% ist kann es ja nur an Code liegen der dauernd ausgeführt wird.
Also :
Delphi-Quellcode:
procedure TForm1.DXTimer1Timer(Sender: TObject; LagCount: Integer);
begin
DXInput1.Update;
DXSpriteEngine1.Move(1);
DXDraw1.Surface.Fill(0);
DXSpriteEngine1.Draw;
DXDraw1.Flip;
end;
oder
Delphi-Quellcode:
procedure TSpieler.DoMove(MoveCount : Integer);
var Strecke : Double;
xWeg,yWeg, xDiff,yDiff, Schritte : Double;
begin
inherited DoMove(MoveCount);
if (IsLeft in Form1.DXInput1.States) and (Move = false) then begin
aX := Station.Links.X + (Station.Width/2);
ay := Station.Links.y + (Station.Height/2);
Move := true;
end;
if (IsRight in Form1.DXInput1.States) and (Move = false)then begin
aX := Station.Rechts.X + (Station.Width/2);
ay := Station.Rechts.y + (Station.Height/2);
Move := true;
end;
if Move = true then begin
xWeg := Ax -x;
yWeg := Ay -y;
Strecke := Sqrt(Sqr(xWeg)+Sqr(yWeg));
Schritte := Round(Strecke / 2);
if Schritte = 0 then Schritte := 20;
xDiff := xWeg / Schritte;
yDiff := yWeg / Schritte;
x := x + xDiff;
y := y + yDiff;
if (x = Ax) and (Ay = y) then Move := false;
end;
Collision;
end;
Ansonsten wir bei mir nichts dauernd ausgeführt...
@ mbamler : Mh ok.. dann kann ichs wohl nicht ändern...