2
\$\begingroup\$

I am trying to implement ice sliding physics on a plane for my game. There are a lot of N64 games that implemented them perfectly well, like Banjo-Kazooie, Super Mario 64, Zelda: OoT and MM, etc.

Here is an example: http://youtu.be/p2D4Y4tMOas?t=19s

Looked up everywhere and I can't find a guide for it. Anyone knows how to do this? Thanks.

\$\endgroup\$
1
  • \$\begingroup\$ Ice is just a low-friction surface. You'll probably have more luck googling for information about implementing friction in game physics. \$\endgroup\$ Commented Feb 19, 2014 at 2:10

1 Answer 1

2
\$\begingroup\$

The very simple version is reducing the velocity of the player by a set amount (when he isn't holding down any controls) on normal terrain, and reducing it less on ice.

You can also go for the physics approach, which is more complicated, but will result in more realistic results.

Crash Course - Physics

The player has a mass. Ice (and other surfaces) has a friction coefficient. Multiply the coefficient by the mass of the player to get a scalar force. Apply the force in the opposite direction of the player's motion.

Force = Mass * Acceleration. Divide force by mass to get the acceleration of the player. Multiply acceleration by time (seconds) to get change in velocity.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Another way to think of this is that, when on a surface, the player's velocity is adjusted by a varying amount to match the velocity of that surface. Thinking about it this way, it works for moving platforms too. Stationary ground is just a special case where the velocity of the surface is zero. \$\endgroup\$
    – DMGregory
    Commented Feb 19, 2014 at 3:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .