Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables,...
-
Upload
joanna-fleming -
Category
Documents
-
view
214 -
download
0
Transcript of Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables,...
![Page 1: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/1.jpg)
Alice 3.0Alice 3.0A Guided TourA Guided Tour
Mike R-D
YRDSB
![Page 2: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/2.jpg)
Agenda
General Walkthrough of Alice 3.0
Loops, Variables, Threads
Methods / Properties
Arrays
Misc
![Page 3: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/3.jpg)
Warning!!
Alice 3.0 is still in Beta
http://bugs.alice.org:8080/secure/IssueNavigator.jspa?reset=true&pid=10000&status=1
![Page 4: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/4.jpg)
Getting Alice 3.0
The beta and all updates can be found at:
http://kenai.com/projects/alice/
Just download, run, will install (need internet access)
![Page 5: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/5.jpg)
Overview
Start UpEditorScene Set upCamera ControlWriting Programs
![Page 6: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/6.jpg)
Start Alice: Editor Overview
DETAILS
Run Button
VIEW
EDITOR
Control Structures
Object Tree
Go to Scene Set Up
![Page 7: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/7.jpg)
File: New…
Different Scene Templates
Template view
Initial backgrounds
![Page 8: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/8.jpg)
File: Open…
Choose either My Projects or File System
Click on either tab (File System selected, here)
![Page 9: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/9.jpg)
The 2 Views of Alice: Code Editor
Control Structures
Return toScene Editor
Editor
Objects public methods, procedures and properties
![Page 10: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/10.jpg)
The 2 views of Alice: Scene Editor
VIEW
Object Tree
Return toEditor
Run Button
Add SimsAdd other objects
Camera Controls
![Page 11: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/11.jpg)
Gallery
In Scene Set UpGeneric Alice Models
Looking Glass Characters
Looking Glass Scenery
Sims
NOTE: Single-click to navigate the gallery!
![Page 12: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/12.jpg)
Add An Instance of a Class
Find the Class in the GallerySingle-click
Prompted with dialog boxChange name if you wish
Click OK
The instance (a particular object of the class) will be added to the scene
Tile added to the object tree
![Page 13: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/13.jpg)
Add an instance of a Sim
![Page 14: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/14.jpg)
Position of Instances in Scene
Click on the instanceWill see a yellow bounding box
Mouse ControlsClick + drag: position object horizontally
Click + ctrl + drag: turn object right and left
Click + shift + drag : Vertical
Future:Roll the object from top to bottom, side to side
![Page 15: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/15.jpg)
Camera Placement
Be careful! Easy to get lost, no easy way to get back at the momentMouse
Right-click + drag: move camera horizontallyLeft, right, forward, back
Shift + right-click + dragMove camera vertically
Ctrl + right-click + dragTurn the camera
Mouse control wheelZoom the camera
![Page 16: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/16.jpg)
Write a Program
In the Editor View
Select instance from the object tree
Select method in details pane and drag to the editor window
Drop in indicated position
Select parameter values if presented with choices
![Page 17: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/17.jpg)
Copy / Delete
Delete instances from programRight-click on object in object tree
Select delete
Delete program statementsRight click on statement in editor
Select delete
Copy statementsAlt + click + drag to position for the new statement
Has some problems, use judiciously
![Page 18: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/18.jpg)
Demo
Note the export feature
![Page 19: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/19.jpg)
On your own
Launch Alice 3.0
Create a world with 1 sim, experiment with the different movements
Explore the functionality
For next part: Line up 5 sims in a row, have each do jumping jacks together, with a 5-second pause between each jack
![Page 20: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/20.jpg)
On Your Own
The file OnYourOwn1.a3p has been placed at http://www.cheshire.ca/si2009
![Page 21: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/21.jpg)
Alice 3.0
More Advanced Stuff
![Page 22: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/22.jpg)
1) Loop, Variables, Threads
Alice has a built-in Threading mechanism to allow things to happen at the same time (same as Alice 2.0)
Alice has conditional and counting loops
Alice allows variables at the class and at the method level.
![Page 23: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/23.jpg)
1) Threads, Loops and Variables
Demo - Astronaut
![Page 24: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/24.jpg)
2) Create your own methods / properties
Considerably different from Alice 2.0
Allows access to constructor
Still has procedure-function split
![Page 25: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/25.jpg)
2) Gravity Demo
Set-up scene withSim
Ball (Sports)
Create scene property called gravity
Create ball or scene method called drop
implement
![Page 26: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/26.jpg)
3) Arrays
An array is a container object that holds a fixed number of values of a single Type.
Comic strip: an array of drawings
![Page 27: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/27.jpg)
3) Arrays
1D only
Must create objects first, then create the array and add the objects into them
In Alice 2.0 and 3.0 this starts to stress your sanity
Try creating a pacman game!!
![Page 28: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/28.jpg)
3) Arrays [1D only]
![Page 29: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/29.jpg)
Alice ZombiesZombieDance.a3p
Array of 5 ZombiesArray of 5 Zombies
![Page 30: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/30.jpg)
Indexing example
As in Java, indexing begins at 0.
The last zombie is at index 4.
Jasper the zombie will kick
his right leg
Jasper the zombie will kick
his right leg
0 1 2 3 4
![Page 31: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/31.jpg)
Iterating through an array- Alice
In Alice, a for each loop can be used to access each object in an array, one at a time.
Each of you zombies, kick
your leg!
Each of you zombies, kick
your leg!
![Page 32: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/32.jpg)
3) Your Turn!!
Let’s rehash our old demo
We want to use an array instead of individual variables
Create an array, add all the sims to it, change the code to use ‘each in x together’
![Page 33: Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.](https://reader035.fdocuments.us/reader035/viewer/2022081520/5697bf831a28abf838c8643d/html5/thumbnails/33.jpg)
Other Neat Stuff
Let’s take our demo and export as a movie or send to Youtube.
Capturing Mouse/Key events [work in progress]