You'll need to also include the X component:
That is what I did initially but it behaved differently from what I was expecting.
To decide the velocity for a missile, it's a simple X=R*cos(angle), Y= R*sin(angle).
I think that is what I was looking for.I should have thought of that lol.
This code is a bit of a code smell. If you want to have a variety of rocket behaviors, you may want to consider inheritance here.
I applied inheritance for some other basic stuff but not for missile behaviours.
This is my first game with c++ but I think I know what you mean.
I should basically move the:
if(missile->getType() == Missile::Player){
// Missile angle of player is only vertical
sprite.move(0,-missile->getVelY()*refreshRate);
} else {
// This part needs to change from vertical to angles of 45,90,135 degrees
// sprite.move(0,missile->getVelY()*refreshRate);
}
inside the missile class. Am I correct?

Find content
Male