So i have this code :
https://github.com/Itex34/2d-Shooting-Game/blob/main/Gun.cpp
and i want to create multiple instances of the pellet object with different velocity directions.
I'm kind of stumped and i feel like my code is kind of messy so it's hard to figure a solution out.
The lines that calculate the velocity are these two :
pelletVelX = pelletSpeed * cos((initialRotationAngle - 47) * M_PI / 180);
pelletVelY = pelletSpeed * sin((initialRotationAngle - 47) * M_PI / 180);
Lines 39 and 40 in my code.
The thing is the pellet math is done in the gun.cpp file and not the pellet.cpp file.
Maybe I should move the math to the pellet.cpp file?