140 likes | 279 Views
Introduction to Object-Oriented Programming in Alice. Creator: Barb Ericson Georgia Institute of Technology Presenter: Mr. McCune Y.E.S. Beyond Limits December 2010. Learning Goals. Introduce computation as simulation Activating Activity Story boarding from 2D-3D Introduce Alice
E N D
Introduction to Object-Oriented Programming in Alice Creator: Barb Ericson Georgia Institute of Technology Presenter: Mr. McCune Y.E.S. Beyond Limits December 2010 01-Intro-Object-Oriented-Prog-Alice
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
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
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
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
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
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
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
Designing a Solution in Alice To create a design, we borrow the idea of storyboardsfrom professional animators at Disney, Pixar, etc. 01-Intro-Object-Oriented-Prog-Alice
Recall…. Princess Escape A 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
Visual Storyboards 01-Intro-Object-Oriented-Prog-Alice
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
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 01-Intro-Object-Oriented-Prog-Alice