I have a top down shooter wherein I generate a projectile on each mouse click at the player's position and translate it in a straight line until it reaches the edge of the screen.
I also have powerups that enhance the player's current weapon by giving a multishot for a certain time span. Here's my problem. I'm not sure of how to place the projectiles relative to the player so that they are offset to the "left" and the "right" instead of directly on the player's position.
In order words, I will need to:
Vector2 playerPosition = playerOne.Position; Vector2 projectileOnePosition = playerPosition + offsetVector; Vector2 projectileTwoPosition = playerPosition - offsetVector;
I'm having trouble calculating the offset vector because I need to take the current rotation of the player in to account as well.
TL;DR: How do I find a point relative to the player's current position taking rotation of the current player in to account? My theory is that it involves calculating a circle around the player with a specific radius that determines the distance away from the player and placing the points somewhere on that circle.
I can draw a picture if necessary. Right now I'm on my laptop so it isn't draw-friendly.