O'Reilly logo

Foundation Game Design with ActionScript 3.0, Second Edition by Rex van der Spuy

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

Image

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 ...

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