|
-
Apr 30th, 2012, 08:17 AM
#1
Thread Starter
PowerPoster
Space ship movement formula
Hi guys,
In my 2D game I have a space ship defined by position, speed and angle (or speed vector if you prefer). Now the player can control both, speed and angle, by clicking on the screen. This makes the ship accelerate and turn to the desired speed and angle over time (eg. 2 seconds).
My problem is to calculate the ship's position and angle at any given time. I've had no problems calculating the position as long as there's no change in the angle. That's simply an accelerated body. But what I need is an accelerated rotation at the same time.
Please also note that my game has no "main loop". So in the worst case the code only gets the initial input, like "player wants to accelerate to speed x and angle y", calculates the necessary time, say t, and the next "frame" is calculated after t seconds already.
Can anyone help me with this?
Last edited by Fox; Apr 30th, 2012 at 08:25 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|