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

Defining a mouse button listener

In this recipe, we will make two robots dance when the user clicks on the scene. We will define a mouse button listener and we will add the necessary code to make two robots dance when the user clicks on the scene.

Getting ready

We have to be working on a project with two characters from the Looking Glass Characters gallery. Therefore, we will create a new project and set a simple scene:

  1. Select File | New... in the main menu to start a new project. A dialog box will display the six predefined templates with their thumbnail previews in the Templates tab.
  2. Select SnowyProject.a3p as the desired template for the new project and click OK. Alice will display a snowy ground with a light blue sky.
  3. Click on Edit Scene, at the ...

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