Top Banner
Fall 2008 ACS-1805 Ron McFadyen 1 ACS-1805 Introduction to Programming using Alice 2.0 Ron McFadyen Course Outline
12

Fall 2008ACS-1805 Ron McFadyen1 ACS-1805 Introduction to Programming using Alice 2.0 Ron McFadyen Course OutlineMcFadyenOutline.

Dec 19, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Fall 2008ACS-1805 Ron McFadyen1 ACS-1805 Introduction to Programming using Alice 2.0 Ron McFadyen Course OutlineMcFadyenOutline.

Fall 2008 ACS-1805 Ron McFadyen 1

ACS-1805

Introduction to Programming

using Alice 2.0

Ron McFadyenCourse Outline

Page 2: Fall 2008ACS-1805 Ron McFadyen1 ACS-1805 Introduction to Programming using Alice 2.0 Ron McFadyen Course OutlineMcFadyenOutline.

Fall 2008 ACS-1805 Ron McFadyen 2

Alice 2.0, an introduction

• Alice 2.0 is a modern programming environment with:

• 3-D graphics

• 3-D models of objects

• Text: Learning to program with Alice; contains CD with software

• Latest version available at www.alice.org

• Originated, and development continues, at Carnegie Mellon University

• A similar environment, Panda3d, exists for the more advanced programmer. Pand3d was originally developed at Disney.

Page 3: Fall 2008ACS-1805 Ron McFadyen1 ACS-1805 Introduction to Programming using Alice 2.0 Ron McFadyen Course OutlineMcFadyenOutline.

Fall 2008 ACS-1805 Ron McFadyen 3

Alice 3.0

• CMU and Electronic Arts are developing Alice 3.0 to provide objects from "The Sims" in a complete Java environment.

• 2008 (?)

2.0 vs 3.0

An aside (a point of interest)

Page 4: Fall 2008ACS-1805 Ron McFadyen1 ACS-1805 Introduction to Programming using Alice 2.0 Ron McFadyen Course OutlineMcFadyenOutline.

Fall 2008 ACS-1805 Ron McFadyen 4

Alice 2.0• Virtual worlds

• Start a program by playing a virtual world

• Can play like a movie, or play like an interactive game

• Developing a world begins with a template (e.g. ground & sky)

• Objects

• Objects are added to the world (e.g. a person, a robot, a ball)

• Objects are chosen from a gallery of 3D models

• Object-oriented

• objects can do things – we send them messages commanding them to do what is necessary for an animation (e.g. move, turn, speak)

• Commands are contained in methods

• Event-driven

• User can interact with a world using the mouse or keyboard

Page 5: Fall 2008ACS-1805 Ron McFadyen1 ACS-1805 Introduction to Programming using Alice 2.0 Ron McFadyen Course OutlineMcFadyenOutline.

Fall 2008 ACS-1805 Ron McFadyen 5

Alice 2.0

• Emphasizes programming fundamentals

• Programs are composed of methods

• Methods contain Alice instructions

• Objects are asked to do things they know how to do

• Events can trigger execution of program components

• Programs always run

• Alice has a smart editor with visual drag & drop (you tend to use the mouse more than the keyboard)

Page 6: Fall 2008ACS-1805 Ron McFadyen1 ACS-1805 Introduction to Programming using Alice 2.0 Ron McFadyen Course OutlineMcFadyenOutline.

Fall 2008 ACS-1805 Ron McFadyen 6

Demo1: running an example

• Start Alice

• Load and run a world

• snowLove (from Examples worlds)

• Pause, Restart, Stop

Page 7: Fall 2008ACS-1805 Ron McFadyen1 ACS-1805 Introduction to Programming using Alice 2.0 Ron McFadyen Course OutlineMcFadyenOutline.

Fall 2008 ACS-1805 Ron McFadyen 7

Demo2: create a world

• Create a new world

• File New

• Select the Templates tab

• Choose a template

• Later on… remember to save your world

Page 8: Fall 2008ACS-1805 Ron McFadyen1 ACS-1805 Introduction to Programming using Alice 2.0 Ron McFadyen Course OutlineMcFadyenOutline.

Fall 2008 ACS-1805 Ron McFadyen 8

Demo2: Adding objects• Adding

objects• Click the

Add Objects button

• Click on Home, Local Gallery, Animals

• Click and drag an animal to the world

Page 9: Fall 2008ACS-1805 Ron McFadyen1 ACS-1805 Introduction to Programming using Alice 2.0 Ron McFadyen Course OutlineMcFadyenOutline.

Fall 2008 ACS-1805 Ron McFadyen 9

Demo2: Adding objects• Manipulating

a scene• Use your

mouse to move objects about

• Move the camera to get a different angle

• Switch to quad view to more precisely move objects about

Page 10: Fall 2008ACS-1805 Ron McFadyen1 ACS-1805 Introduction to Programming using Alice 2.0 Ron McFadyen Course OutlineMcFadyenOutline.

Fall 2008 ACS-1805 Ron McFadyen 10

Classes• Objects are categorized/organized into classes

• e.g. Frog

• An object is an instance of the class.

• e.g frog1, george, mary

Frog

frog1marygeorge

Page 11: Fall 2008ACS-1805 Ron McFadyen1 ACS-1805 Introduction to Programming using Alice 2.0 Ron McFadyen Course OutlineMcFadyenOutline.

Fall 2008 ACS-1805 Ron McFadyen 11

Object Parts• Objects may be complex

• aliceLiddell has a rightArm

• The rightArm comprises a shoulder, and forearm, and the forearm has subparts too.

• A “+” means there are subparts that can be listed by clicking on the “+”

• A “-” means the subparts are listed. To suppress the listing of subparts click the “-”

• The picture on the right is showing the objects in a “tree” view

Page 12: Fall 2008ACS-1805 Ron McFadyen1 ACS-1805 Introduction to Programming using Alice 2.0 Ron McFadyen Course OutlineMcFadyenOutline.

Fall 2008 ACS-1805 Ron McFadyen 12

Object Parts

aliceLiddell

rightArm leftArm neck lowerBody

shoulder forearm

hand

thumb

fingerTips

fingers

forearm

hand

thumb

fingerTips

fingers

shoulder

Consider the aliceLiddell object to the right. A computer scientist typically uses tree diagrams for complex hierarchical structures. Can you complete this for neck and lowerBody?

… …