I have a simple WASD controller to rotate the player, but if I press W and the player has been rotated by 20 degrees, it will only rotate around the x axis.
Yes, it's logical, but how I should I calculate rotation around the x and y axis?
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.Sign up to join this community
You just have to use the trigonometric ratios. Lets say that you have rotated the character 20 degrees and you have a speed of 2 pixels per update.
PosX += cos(20)*2 PosY += sin(20)*2