Y
Hacker News
new
|
ask
|
show
|
jobs
by
bakugo
205 days ago
The game has ammo pickups that refill 20% and 50% of whatever your max ammo is, so floats have to be involved in there somewhere.
1 comments
manwe150
205 days ago
Dividing by 5 or 2, respectively, are integers, if the game developers wanted them to be. More so because the actual units of ammo need to be integers if they are to render as full bullets each
link
shultays
204 days ago
Or more generalized "ammo += (maxAmmo * percentageToFill) / 100"
link