O'Reilly logo

Alice 3 Cookbook by Vanesa S. Olsen

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

Controlling multiple actors with keystrokes

In this task, we will use two sets of keys to control two different robot’s movements. We will declare and call specific procedures to handle the necessary movements for the robots. We will evaluate many expressions to determine the key pressed by the user and run the necessary code according to this key.

Getting ready

We will use an existing project that allows the user to move biff by using the arrow keys. This project also includes gina in the scene, another character from the Looking Glass Characters gallery.

  1. Open the project saved in the Controlling the camera with the keyboard recipe.
  2. Click on Edit Code, at the lower-right corner of the big scene preview. Alice will show a smaller preview of the scene ...

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