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

Running conditional code

In this recipe, we will run many statements according to the results of the evaluation of expressions. We will create blocks of code that will run when an expression evaluates to true or false. A bee and a red bird will respond to the evaluation of expressions.

Getting ready

We will be working on a project with at least two actors. Therefore, we will use an existing project that has a bee and a red bird. This project also has two purple flowers in the scene and a grassy ground.

  1. Open the project saved in the Performing many statements in order recipe, in Chapter 3, Organizing Statements. In this project, there is some distance between the redbird and the bee.
  2. Click on Edit Code, at the lower-right corner of the big scene preview. ...

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