• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

SOLVED Need help with a physics based cannon game

I want to make a game where a physics object is launched from a cannon at different speed and powers, the problem is getting the object to launch out at the angle of the cannon but the function physics_apply_impulse() is based on having an x force and a y force not a power and an angle... so my question is is there any way to translate an angle to the the 2 forces?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Use the lengthdir_x/y functions to get the x/y vectors for the impulse functions. Just give the launch angle as the direction and the force for the length. :)

PS: you may need to offset the direction by 90º as the physics directions have 0º at the top, not to the right, IIRC.
 
Top