Difference between revisions of "Ball Friction"
From ASSS Wiki
m (renamed a variable to make it more obvious) |
m (adding category) |
||
| Line 20: | Line 20: | ||
} | } | ||
</pre> | </pre> | ||
| + | |||
| + | [[Category:Game Intricacies]] | ||
Revision as of 17:49, 9 March 2008
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;
}
}