Feb-18-2020, 07:51 PM
(This post was last modified: Feb-18-2020, 07:54 PM by michael1789.)
Your problem is in your when you hit 100 points you check_level()every frame and add 1 to the level each frame.
The way I can think to fix it is to have a variable for
Something like this
level_up() would be a good place to add a sound for level change too. Will make it more fun for you to test.
The way I can think to fix it is to have a variable for
next_level
and have it look to hit that. So when you get 100 points, you level up and then add 100 points to the next_level variable.Something like this
def level_up() level += 1 next_level += 100 if score >= next_level: level_up()
level_up() would be a good place to add a sound for level change too. Will make it more fun for you to test.