gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > slip sliding along...

#65115 - QuantumDoja - Fri Dec 30, 2005 10:13 am

Hi, I have noticed while playing games such as mario and yoshi's island that the player can accelerate to a max speed and then decelerate, and on mario, the player will acctually kind of slide to a halt over the space of about 5 pixels after running.

To acheive this effect, do i need to add say the following properties to my main player class:
.AccelerationRate
.DecelerationRate
.Velocity
.MaxSpeed

I want my main player to speed up if the forward button is held over a certain x amount of frames, and then when let go, the main player will decelerate and 'slide'

Any help appreciated!!! :-)
_________________
Chris Davis

#65116 - sgeos - Fri Dec 30, 2005 10:19 am

friction

-Brendan

#65169 - sajiimori - Fri Dec 30, 2005 9:34 pm

QuantumDoja,

The solution you described sounds reasonable. Were there any aspects of it that you're having trouble implementing?