VBGamer |
|||||||||||||||||||||||||||
RE: Maths problem Corre (1 reply, 0 views) (2000-Aug-30)
Set it up like this:
Type tMove
dX As Single
dY As Single
End Type
Dim Angle As Integer
Dim Moving(0 to 359) As tMove
For Angle=0 to 359
Moving(Angle).dX = Sin(Angle * 3.14 / 180)
Moving(Angle).dY = Cos(Angle * 3.14 / 180)
Next Angle
Then, if you want to move the character, just do this
Character.Xpos=Character.XPos+Moving(Character.Angle)
Character.Ypos=Character.YPos+Moving(Character.Angle)
Just remember to keep all positions as Single or Double (not Integer)
/Corre
|