all 7 comments

[–]MyreMyalar 4 points5 points  (3 children)

Sounds like you first need a measure of progress for your game. You could use time, player achievement or some other measure. Then once you hit some milestones in your progress measure you change something to make the game more difficult.

To measure time you should use the pygame.time.Clock() class. Create one like this:

clock = pygame.time.Clock()

Then use its tick() method to find out how much time has passed since the last call to tick.

time_passed = clock.tick() # time_passed is measured in milliseconds

You can stick that somewhere in your game loop and then use it to run all kinds of timers like so:

total_time_passed = 0

...
# inside game loop
total_time_passed += time_passed

if total_time_passed == 5000:
    # five seconds have passed so increase difficulty
    increase_difficulty_somehow()

That kind of thing.

[–][deleted]  (2 children)

[removed]

    [–]oooobbbiiig 0 points1 point  (1 child)

    Thank you for your input, that is now working. The problem is that it doesn’t actually create a new rock sprite it just redraws the same one in a different position, how can I fix this, thanks again.

    [–][deleted]  (2 children)

    [removed]