Performance fixHi folks,
When i played my game on another computer i realised, that the quick hack i made to run the game at 30 fps may does not work on other computers as well. So i changed it. So if the games running slow (you can indicate this, when the time counter in the upper left decreases the seconds too slow), then please use my fix.
For this replace the function start_game_loop() in lib/main.py with the following code fragment:
def start_game_loop( self ): while self.run_game: ticks_start = pygame.time.get_ticks() # handle events self.handle_events() # update objects self.tick() # draw stuff self.draw() # check wining condition self.check_win_or_loose_conditions() ticks_end = pygame.time.get_ticks() # wait a little to get 30fps ticks_diff = ticks_end - ticks_start if ticks_diff < 1000/frames_per_second: pygame.time.delay( 1000/int(frames_per_second)-ticks_diff ) return