Autor Beitrag
Ironwulf
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 733
Erhaltene Danke: 2



BeitragVerfasst: Fr 26.08.05 21:53 
Hy, ich hab folgendes problem, wenn ich mein sprite drehen will dann dreht es sich zu weit, so das ein angle- wert von ca. 255 einer 360 grad drehung entspricht, woran könnte das liegen?

hier noch ein wenig kot
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
  if isleft in Form1.DXInput1.States Then
  begin
    Winkel:= Winkel - 10;
  end;

  if isright in Form1.DXInput1.States Then
  begin
    Winkel:= Winkel + 10;
  end;

  Angle:= Winkel


Moderiert von user profile iconAXMD: Code- durch Delphi-Tags ersetzt.
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Fr 26.08.05 21:54 
Ich VERMUTE, dass es sich um Kreisbogen-Winkel handelt. dabei entspricht 2Pi 360°.

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Sa 27.08.05 08:02 
Jep. Der Kreis bei 'Angle' hat 256°.
Also Prüfung hin:
ausblenden Delphi-Quelltext
1:
2:
if Angle > 255 then
  Angle := 1;

Musst dann noch auf die andere Drehung anpassen.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Ironwulf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 733
Erhaltene Danke: 2



BeitragVerfasst: Sa 27.08.05 17:07 
joa danke, habs mir die nacht noch zusamm gegoogelt

zu vervollständigung
ausblenden Quelltext
1:
Angle:= Round(Winkel*256/360)