
-----------------------------------
david92ng
Tue Jul 29, 2008 9:47 pm

How to make a sprite go 360 and move correspondingly
-----------------------------------
I am making this space shooter game.

The sprite has to be able to turn 360 and move to a target angle. I also need help in movement of the sprite, moving 360 has different changes in x and y. and it must corospond to current angle. Also, i want a delayed turn, not like (current angle = target angle)The thing is... i have no idea how to do it...
how it will be able to do that is that the target angle will be determined by the poisition of the mouse, which i already figured out.

My old approach was to check if target angle was larger or smaller then current angle. But movement really defied physics because movement and angle of where its pointing is dependant upon themselves. So... if someone can tell me the code or at least tell me the theory please.

Also, how do i make bullets go 360? My bullets are basically a line, (x,y,x2,y2) and after a loop, x:=x2 y:=y2. Therefore, my bullets fly. but i cant get to control the speed of it. I tried to find the slope of the trejectory of the bullet and kinda try it that way but its all confusing... ugh,,

So please... can someone help me write this...? im sure your games have this simple code/concept that i havent seen yet...(i know forum rules but really need this done, working on this too long >.