Ball Friction

From ASSS Wiki
Revision as of 18:49, 9 March 2008 by Smong (talk | contribs) (adding category)
Jump to: navigation, search
fireball()
{
   ball.frictiontimer = 1000000;
}

// call this per tick
updateball()
{
   if (ball.xspeed && ball.yspeed)
   {
      int workfriction = ball.frictiontimer / 1000;
      ball.xspeed = ball.xspeed * workfriction / 1000;
      ball.yspeed = ball.yspeed * workfriction / 1000;

      ball.frictiontimer -= cfg_friction;
      if (ball.frictiontimer < 0)
         ball.frictiontimer = 0;
   }
}