Presentation is loading. Please wait.

Presentation is loading. Please wait.

Part II Reference: www.pygame.org.

Similar presentations


Presentation on theme: "Part II Reference: www.pygame.org."— Presentation transcript:

1 Part II Reference:

2 Drawing shapes in pygame
[Example: Drawing n circles] Evenly spaced Shifting colors [Example: Animating a circle]

3 The Game Loop Animation / Game loop Erase the screen
[Get input from the user] (GameLoop only) Update variables Draw (using variables) Flip [Brain absorbs info while new screen is being drawn]

4 Window input (common to nearly all OS's)
Application == Window (to the OS) Application might have sub-windows Buttons, Menus, … OS sends messages (events) to the App Upon creation Minimize / Maximize / Resize / Close Mouse / Keyboard / Gamepad events

5 Events and pygame Pygame gives us two choices:
Handle (new) events manually Ask pygame for a list of Event objects Iterate through it (hint: while or for loop) We'll look at this a bit later… Let pygame handle it Call pygame.event.pump() Process all waiting events Saves result in status variables Access the status variables [Example]


Download ppt "Part II Reference: www.pygame.org."

Similar presentations


Ads by Google