Controlling an actor with the mouse
In this recipe, we will make the robots dance when the user clicks on them. The user has to place the mouse pointer over the 3D model that represents the robot and click to make it dance. We will add code that Alice will execute when each robot gets clicked.
We will use an existing project that has two characters from the Looking Glass Characters gallery.
- Open the project saved in the Reacting to mouse events recipe.
- 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 the right-hand side of the main window.
- Click on the class: MyScene drop-down list and the list of classes that are ...