Chapter 10. Game Programming: Coding for Fun

In Chapter 9, we combined animation and user interaction to make a fun app. In this chapter, we’ll build on those concepts and add elements of game design to create a game from the ground up. We’ll combine our ability to draw animations on the screen with our ability to handle user interaction, like mouse movement, to create a classic Pong-type game we’ll call Smiley Pong.

Games that we enjoy playing have certain elements of game design. Here is a breakdown of our Smiley Pong design:

  • A playing field or game board. A black screen represents half a Ping-Pong board.

  • Goals and achievements. The player tries to score points and avoid losing lives.

  • Playing pieces (game characters and objects). The player has ...

Get Teach Your Kids to Code now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.