O'Reilly logo

Program Arcade Games: With Python and Pygame, Fourth Edition by Paul Vincent Craven

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 9

image

Introduction to Animation

To begin our first animation, let’s start with the base pygame program from Chapter 6 that opens up a blank screen. Source for pygame_base_template.py can be found here:ProgramArcadeGames.com/python_examples/f.php?file=pygame_base_template.py

We will put together a program to bounce a white rectangle around a screen with a black background. Feel free to pick your own colors; just make sure the background color is different than the rectangle color!

9781484217894_unFig09-01.jpg

First step: start with the base template and flip the background ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required