Hi!
This is something I've asked for help with in a previous thread (Recoil!), but I've come up with a new way of doing it... And I need some maths.
So in order to create some recoil for my weapons I need to propel the player in the opposite angle to that which the weapon was fired.
I figure I can do this using Platform.VectorX and VectorY, but I need to know how to get the correct X and Y values/ratio to give the player depending on the angle which the weapon was fired.
So...
If Angle is 0 then I want player propelled VectorX -100 Y 0
If Angle is 180 then propel VectorX 100 Y 0
If Angle is 45 then propel VectorX -100 Y 100
If Angle is 135 then propel Vectox 100 Y 100
But I need to know the formula than I can use to calculate the X and Y for all directions. I'm sure there must be one. It's maths after all!