lordmauve / pgzero

A zero-boilerplate games programming framework for Python 3, based on Pygame.
https://pygame-zero.readthedocs.io/
GNU Lesser General Public License v3.0
536 stars 188 forks source link

Introduction to Pygame code fail #206

Closed madtom1999 closed 4 years ago

madtom1999 commented 4 years ago

in the CLOCK section of the introduction def on_mouse_down(pos): if alien.collidepoint(pos): sounds.eep.play() alien.image = 'alien_hurt' time.sleep(1) alien.image = 'alien' the image doesnt change on screen. If I move to the next section with def set_alien_hurt(): the image does change. I'm guessing there is no re-draw in the event code until it returns? Running this through Thonny with pgzrun.go()

lordmauve commented 4 years ago

This is given as an example of code that will not work.

Unfortunately, this is not at all suitable for use in a game.