VBGamer |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RE: Calculation question Rag on a Stick (5 replies, 0 views) (2000-Sep-26) Put this line in your declarations section:
Const Rad = 3.1315 / 180
Because the Sin and Cos use radians, multiply things by Rad to convert them.
dx and dy are the distance that you will move the missile each frame.
'When the player fires:
Angle = PlayerAngle * Rad
dx = Sin(Angle) * Power
dy = Cos(Angle) * Power
Then, to update the position:
BulletX = BulletX + dx
BulletY = BulletY + dy
dy = dy + Gravity
|