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

Working with many local variables

In this recipe, we will use two local variables to control the number of units that two different birds have to move forward in each iteration. We will use a descriptive name for each variable, and therefore the purpose of the code will be easier to understand.

Getting ready

We will use an existing project that has a local variable declared to define the number of units that birdBaby has to advance in each step. We will declare an additional local variable in the run procedure.

  1. Open the project saved in the Changing values of variables 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 and will display the Code Editor on a panel located at ...

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