I would leave to great a simple level system. When the score Variable reaches a certain number it would increase enemies (balls) & velocity(Speed) for example:
if score >= 500:
enemies=6
velocity=2
I have tried few methods, the my first attempt was like the above within my game loop but I wasn’t able to change it on the fly, Error:
Traceback (most recent call last):
File "C:\Users\MO\Desktop\Twerk\ballbounce_changed.py", line 233, in <module>
game()
File "C:\Users\MO\Desktop\Twerk\ballbounce_changed.py", line 182, in game
positionx[i]=positionx[i]+positionxmove[i]
IndexError: list index out of range
I have also tried other methods which didn’t work. can you please help me implement a level system. My game code can found here: http://pastebin.com/nhqKdR19
Thank you
Instead of:
You should probably have an
increase_difficulty()method that modifies your tracking lists and increases thevelocityvalue. You should also be using>=instead of==as I mentioned above. Then your game loop code would be: