Asteroids-style Controls

This recipe shows how to control a ship in the style of the classic game Asteroids. The ship is a simple sprite. Keyboard controls are used to apply clockwise and counterclockwise rotation as well as acceleration in the orientation of the ship.

Live Demo

Controls

Source Code

Back to cookbook.