I have an Entity
instance which is updated every game tick. Let's just assume that entity moves forward constantly. I'd like to be able to give the entity's angle to a function that makes it move in that direction:
moveForward(90);
should make them move to the right. If I declared my rotation as a global int
, then doing
moveForward(rotation);
rotation++;
would make it trace a small circle with its movement.
How can I do this? I assume this involves vector math; I don't know any, so a brief explanation would be nice.