timer++;
if(timer>=30 && HP<50) // 1 second, 50 is max HP limit
{
HP++;
timer=0;
}
timer++;
if(timer>=real_fps && HP<50) // 1 second, 50 is max HP limit
{
HP++;
timer=0;
}
lcl wrote:Hblade, better to use real_fps instead of 30.
So the code would be:
- Code: Select all
timer++;
if(timer>=real_fps && HP<50) // 1 second, 50 is max HP limit
{
HP++;
timer=0;
}
Users browsing this forum: No registered users and 1 guest