Raspberry_Pi_Education_Manual

Notes:

>>> position = (280,300) >>> radius = 80 >>> pygame.draw.circle(surface, mintcream, position, radius, linewidth) >>> pygame.display.update ()

If you want to start again, just fill the surface with blue, and update again.

>>> surface.fill(deepblue) >>> pygame.display.update ()

Not responding When you use PyGame interactively, like this, it can get stuck sometimes. This is because PyGame is trying to send events back to you – information about things it wants you to know about. At this stage, you don’t need to know about them, but you should still tell Python to respond to them. Type in this code and press Return twice, and you will see all the “events” that PyGame wants you to know about. >>> for event in pygame.event.get(): print (event)

To close the PyGame window, use the close [x] at the top-right corner, as you would any desktop window.

Experiments in Python

78

Made with FlippingBook flipbook maker