I want to make a player move in circular but not that he move automatic but manual. Similar like in the game Zero Refelx.
Asked
Active
Viewed 447 times
1
-
3What did you try? – Vaillancourt Aug 16 '16 at 13:04
-
Player.posX = radius * cos(theta), Player.posY = radius * sin(theta) Where theta is the current angle relative to time (theta = omega * time, where omega is the angular velocity - a constant you define, and time is the amount of seconds, milliseconds, whatever unit you want, that has passed since you started the game loop). You might want a stronger understanding of trigonometry before you attempt to make a game involving movement and collisions on curved paths, and next time, try Google first, or search this site to see if your question has already been answered. – Nathaniel D. Hoffman Aug 16 '16 at 13:12
-
You could also write a clamp method to make sure DistanceBetween(Player, Center) == RadiusConstant. Then use Nathaniels methods to move. – lozzajp Aug 16 '16 at 13:42