Chapter 5

Controlling A Player Character

One of the first things your games should do is allow game players to move an object around the stage. A game object could be moved with either the mouse or the keyboard. In this chapter, you'll look at techniques for controlling an object with the keyboard.

This chapter covers the following topics:

  • Using the KEY_DOWN, KEYUP, and ENTER_FRAME events.
  • Stopping the player character at the edges of the stage and screen wrapping.
  • Scrolling: vertical, horizontal, and parallax scrolling
  • How to embed images into a game.

Controlling a player character with the keyboard

One of the most basic things a game should ...

Get Foundation Game Design with ActionScript 3.0, Second 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.