
10-15-2008, 12:23 AM
|
|
Will work for food. Maybe
|
 |
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
|
|
|
An ice-skating script works best in this way: you have two velocities, X and Y. From there, you add to the X and Y velocities depending on the movement of the player. If they're moving left, subtract X velocity, if they're moving right, add to the X velocity. Do the same for up/down and the Y velocity. It's important to allow these velocities to go into the negatives as well. If the player is not moving, move both X and Y velocities toward 0(until they reach 0).
That's about the gist of it. There is also wall-detection and such. |
|
|
|