Set a base speed for the x and y directions. Then, adjust them based on the angle of the direction you're firing.
angle = directionYouWantToFireIn;
Oh and if you make a global variable called deg2rad, make it equal to Math.PI / 180; and replace it in your current code, you'll eek out a little bit smoother gameplay.




Reply With Quote