VBGamer |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RE: Calculation question Kalath (4 replies, 0 views) (2000-Sep-27) Ok thanks that worked... but i want the bullet to move like a rainbow ;) first it goes up then down, not in a straight line.
Rag on a Stick wrote:
-------------------------------
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
|