accelerations/deceleration code
Blitz3D Forums/Blitz3D Programming/accelerations/deceleration code
| ||
I know i've done this before but I always seem to forget the code for it. I'm trying to write a game that uses the keys for a controller. I'm trying to make my entity move in a smooth motion accelerating and decelerating like main ship in asteroids. Anyone have the code for this? |
| ||
You could multiply the speed by 1.001 or whatever values suits when accelerating, and when no key is pressed, multiply the speed by 0.99. Other than that, you could make use of SIN/COS to produce curves for accelerating and decelerating. |
| ||
Here's some code I posted in a similar thread a while back: http://www.blitzbasic.com/Community/posts.php?topic=44999#500732 |
| ||
Some interesting stuff there Stevie. |