1 Chapter 22 Object-Oriented Design. 2 Object-Oriented Design.
Introduction to Object-Oriented Programming in Alice
-
Upload
quintessa-mccall -
Category
Documents
-
view
35 -
download
6
description
Transcript of Introduction to Object-Oriented Programming in Alice
01-Intro-Object-Oriented-Prog-Alice 1
Creator: Barb Ericson
Georgia Institute of Technology
Presenter: Mr. McCune
Y.E.S. Beyond Limits
December 2010
Introduction to Object-Oriented Programming in Alice
01-Intro-Object-Oriented-Prog-Alice 2
Learning Goals
• Introduce computation as simulation
• Activating Activity
• Story boarding from 2D-3D
• Introduce Alice
• Create objects in Alice
• Story boarding from 2D-3D
01-Intro-Object-Oriented-Prog-Alice 3
Computers as Simulators
• “The computer is the Proteus of machines. Its essence is its universality, its power to simulate. Because it can take on a thousand forms and serve a thousand functions, it can appeal to a thousand tastes.” Seymour Papert in Mindstorms
01-Intro-Object-Oriented-Prog-Alice 4
Creating a Simulation
• Computers let us simulate things– We do this by creating models of the things
we want to simulate– We need to define what types of objects we
will want in our simulation and what they can do
• Classes define the types and create objects of that type
• Objects act in the simulation
01-Intro-Object-Oriented-Prog-Alice 5
Running a Simulation
• How many objects does it take to get a person fed at a restaurant?– Pick people to be the customer,
greeter/seater, waiter, chef, and cashier and have them role play
• What data does each of these people need to do his or her job?
• What does each type need to know how to do?• What other objects do you talk about?
• How about simulating going to a dentist?– Or to the movies?
01-Intro-Object-Oriented-Prog-Alice 6
Introduction to Alice
• Free development environment– From Carnegie Mellon University– Available from http://www.alice.org
• Used to create– 3D movies
– 3D games
01-Intro-Object-Oriented-Prog-Alice 7
Getting Started
• Install Alice– Pick CD2
• Windows – copy Alice 2.2 folder
• Macs – click on MacScratch1.4.dmg
• Start Alice– Double Click on Icon
(Alice.exe)
• Wait for Alice to start– Can take a few
minutes
01-Intro-Object-Oriented-Prog-Alice 8
Traditional Problem Solving in CS
• Read and understand the problem or task specification
• Design a solution (develop an algorithm)
• Implement (code)
• Test
• Revise, as needed
01-Intro-Object-Oriented-Prog-Alice 9
Designing a Solution in Alice
• To create a design, we borrow the idea of storyboards from professional animators at Disney, Pixar, etc.
01-Intro-Object-Oriented-Prog-Alice 10
Recall….
• Princess EscapeA princess has been grounded by her
father (a wizard). Being a rather rebellious princess, she has emailed the local dragon taxi service. The dragon will fly to the princess and she will climb aboard the dragon to escape from the castle – to meet some friends at the village dance club.
01-Intro-Object-Oriented-Prog-Alice 11
Visual Storyboards
01-Intro-Object-Oriented-Prog-Alice 12
Textual Storyboard(pseudo code)
Do in order
dragon takes off
dragon flies to princess
princess climbs on dragon's back
dragon and princess escape
knight shakes his arm (and sword) in protest
01-Intro-Object-Oriented-Prog-Alice 13
Turning On Java Syntax
• Click in Edit and then Preferences
• Change the display my program: from Alice Style to Java Style in Color
• Quit Alice and start it up again– It will keep this setting
until you change it again