def onKeyDown(key): global player if key == pygame.K_ESCAPE: game.quit() elif key == pygame.K_RSHIFT or key == pygame.K_LSHIFT: player.speedX(2) elif key == pygame.K_RCTRL or key == pygame.K_LCTRL: player.speedX(.5) elif key == pygame.K_r and game.pause: game.restart()
import helligame as game def timer_done(owner, timer): owner.text += 1 timer.restart() lbl = game.Label(0, (10, 0)) lbl.addTimer(2, timer_done, True) game.mainloop("timer test", game.SKY, 800, 560) game.quit()