Chapter 2. Hello Pong

My addiction to playing video games started when my father purchased Atari’s Home Pong console. It plugged into a standard television, had two controllers, and displayed only in black and white. There were two white rectangles on each side of the screen that represented each player’s paddle. The controller had a rotating dial that placed the paddles into different vertical positions. There was a puck that was represented by a small white square that bounced off the walls and player paddles. Each successful paddle hit would increase the puck speed which in turn made it more difficult to hit. If a player missed the puck then a point would be awarded to the other player and the round would reset, putting the puck speed back to normal.

Although Pong didn’t sport flashy graphics and sounds, it had all the typical elements that current games have: an objective to accomplish, player representation in a world, a score that measures progress, and a way to finish the game. The Atari engineer that designed and built Pong was given the project as a training exercise to help him get acclimated at creating games. I feel that this exercise holds up even today as a great way to teach how to create a game on the iPhone (see Figure 2-1). You will learn how to implement multi-touch controls, animation, collision detection, and scoring.

The Paddles game running in the iPhone Simulator
Figure 2-1. The Paddles game running in the ...

Get Tap, Move, Shake now with O’Reilly online learning.

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