Download presentation
Presentation is loading. Please wait.
1
Classes and Objects Wanda Dann Don Slater wpdann@andrew.cmu.edu
Copyright 2012 Wanda Dann, Don Slater All rights reserved 1
2
Alice Environment Classes Objects Scene Editor Code Editor
Copyright 2012 Wanda Dann, Don Slater All rights reserved 2
3
Each 3D model is a pre-written class In Alice, a class defines
A plan for constructing an object in an Alice scene Actions an object of that class can perform These buttons in the gallery display the classes that are available in Alice can be thought of as instance creation buttons Copyright 2012 Wanda Dann, Don Slater All rights reserved
4
An Alice class is similar to an architect's blueprint for building a house.
Not the actual house -- just a plan for constructing a house, based on a sketch of what it will look like. Copyright 2012 Wanda Dann, Don Slater All rights reserved 4
5
An instance of a class is an object
The following slides illustrate how to create (construct) an object in an Alice scene. Copyright 2012 Wanda Dann, Don Slater All rights reserved
6
Where the program for the animation or game is written
Code Editor Code editor Scene view Methods panel Control tiles Where the program for the animation or game is written Copyright 2012 Wanda Dann, Don Slater All rights reserved
7
Click on Setup Scene to go to the Scene Editor
Go to Scene Editor Click on Setup Scene to go to the Scene Editor Copyright 2012 Wanda Dann, Don Slater All rights reserved
8
Where the scene for the animation or game is created
Scene Editor Scene setup panel Where the scene for the animation or game is created Gallery panel Copyright 2012 Wanda Dann, Don Slater All rights reserved
9
Gallery folders In the gallery, classes are organized in folders.
Each class folder is like a drawer in a file cabinet, where all classes of the same type are stored. Flyer (has wings and can fly) Biped (walks on 2 legs) Quadraped (walks on 4 legs) Swimmer (lives in water, swims) Copyright 2012 Wanda Dann, Don Slater All rights reserved
10
Select class folder Select the class folder for the type of object that you wish to add to the scene. In this example, we click on Quadruped. Copyright 2012 Wanda Dann, Don Slater All rights reserved
11
Quadruped – walks on 4 legs
Within the Quadruped folder are images of each class in this folder. Each image is labeled with the name of the class and shows a preview for an instance of that class. Copyright 2012 Wanda Dann, Don Slater All rights reserved
12
Select class Click on the image to select one of 5 versions of the BabyDragon class. 5 different BabyDragon classes Copyright 2012 Wanda Dann, Don Slater All rights reserved
13
Select class Click on the image to create a new BabyDragon object
Copyright 2012 Wanda Dann, Don Slater All rights reserved
14
Adding a Camel object to a Scene
Enter a name for the new object you are constructing from the BabyDragon class
15
Instance/object We have constructed an instance of the BabyDragon class and identified it with the name fergie. We say an instance of a class is an object. Copyright 2012 Wanda Dann, Don Slater All rights reserved
16
Instance construction - Alternative
An instance of an object may be added to a scene by clicking and dragging the image into the scene view.
17
Instances of same class
Can have more than one instance of the same class. Example: fergie and bert are two instances of the BabyDragon class.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.