CHAPTER 6

image

Introduction to Graphics

9781484217894_unFig06-01.jpg

Now that you can create loops, it is time to move on to learning how to create graphics. This chapter covers:

  • How the computer handles x, y coordinates. It isn’t like the coordinate system you learned in math class.

  • How to specify colors. With millions of colors to choose from, telling the computer what color to use isn’t as easy as just saying “red.”

  • How to open a blank window for drawing. Every artist needs a canvas.

  • How to draw lines, rectangles, ellipses, and arcs.

Computer Coordinate Systems

The Cartesian ...

Get Program Arcade Games: With Python and Pygame, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.