O'Reilly logo

Learn Game Programming with Ruby by Mark Sobkowicz

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 4Creating a Sprite-Based Game

Many video games—from old classics such as Asteroids and Pac-Man, to modern mobile games such as Flappy Bird and Temple Run—are made using sprites. Sprite is a term that dates back to 1970s video game systems like the Atari. It refers to a small image that moves around inside a scene. In a single game there can be many sprites; often one sprite is controlled by the player, and others are controlled by the program.

We’re going to make our own sprite-based game called Sector Five, in which the player moves a spaceship around the screen by pressing keys. Waves of enemy ships descend from above, and the player needs to shoot them before they get to the bottom of the screen and destroy the player’s base. When ...

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