I'm experimenting onmaking a small top-down space shooter where the player controls a ship and he can aim and shoot bullets toward the direction ofusing the mouse cursor. My question is howHow can I shoot the bullets with the angle given by the mouse cursor ?
Currently myfire bullets are created with random "angle values" ranging from -10 to 10 to each the X and Y axis so that way their position values are augmented or diminished each update givingfrom the ship at the illusion that they follow an angle. But that just gives me a bullet that gets shot in a random direction and I need to shoot them in a specific direction (towards the mouse cursor).
I get the feeling I'm missing something here.
Edit : To make things clearer I'm looking for ways to move the projectile alongside an angleangle from the ship to the mouse cursor?