incrementing playerLives help

I’ve been working on this for a few days and looking for any info on the net with no progress.

So I am hoping one of you could help me with a problem I am having. I have a 2D scroller that i made and wish to increment the playerLife by one when the points reach multiples of 100.

I have it now where if the player has 100 points life goes up one but if player hass 99 points and score 5 the life doesnt increment because score != 100.

Any ideas or a point in the right direction?

Thank you BB

I use something like this

int nextExtra=100;
...
...
score += bonus;
if(score > nextExtra){
  lives++;
  nextExtra+=100;
}
..

rdcarv
man thanks that works great!

i was close to meltdown here

BB

I don’t want to be rude or anything, but that’s some basic, extreamly basic math stuff / logic. Maybe you should work on that area.