Hp recovery?

Started by
9 comments, last by Zahlman 15 years ago
Quote:Original post by hiddendragon
and no i actually do not understand y
$hpAccumulator -= SOME_VALUE need to the same value as if($hpAccumulator > SOME_VALUE)


Try thinking about it. Say for example that exactly 30 milliseconds elapses between each update. Trace for yourself what the value of $hpAccumulator will be each time through.

Quote:and does this $ir['hp'] += $hpRegen; code actually go to the database and update the value of ['hp']?


This updates the variable. The variable '$ir['hp']' represents how many hitpoints the player has. (I'm assuming '$ir' is the data for the current player.) The database is for remembering data between plays of the game. Variables keep track of things while the game is running.

This topic is closed to new replies.

Advertisement