Objects and Object-Oriented Programming CS 110 – Honors Slides by Wanda Dann, Ithaca College.

Slides:



Advertisements
Similar presentations
Alice.
Advertisements

Objects and Properties Alice. Objects in Alice Objects already exist. Hundreds of them.
Class-level Methods Chapter 6. Class-level Method Is specific to a class of objects We can give a class new abilities/methods Only involves this one class.
Introduction to Alice Alice is named in honor of
Functions and Visual Effects Chapter 6 Part 3. Built-in Functions We have been using built-in functions so far 2.
Alice: A Visual Introduction to Programming Chapter 1 Part 3.
Introduction to Alice Web Design Section 8-2 Alice is named in honor of Lewis Carroll’s Alice in Wonderland.
CS320n –Visual Programming Random Numbers and Random Motion (Slides 6-3) Thanks to Wanda Dann, Steve Cooper, and Susan Rodger for slide ideas.
Programming: Putting Together the Pieces Built-in Functions and Expressions Alice.
What is Alice? Graphical Programming Environment and Language Learn object oriented programming using 3 dimensional objects and a story telling approach.
Introduction to Alice Basics : What is Alice? Object Oriented Definitions What Does it Look Like? Where Can I Use it?
CS320n –Visual Programming Functions Mike Scott (Slides 6-1) Thanks to Wanda Dann, Steve Cooper, and Susan Rodger for slide ideas.
Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Alice Workshop Problem Solving with Alice 2 & Friends.
Introduction to Alice CS Honors Slides courtesy of Wanda Dann, Ithaca College.
Introduction to Alice Alice is named in honor of Lewis Carroll’s Alice in Wonderland.
Don Slater Wanda Dann Motion and Rotation Copyright 2012 Wanda Dann, Don Slater All rights reserved.
Programming Alice Alice is named in honor of Lewis Carroll’s Alice in Wonderland.
CSC1401: Introductory Programming Steve Cooper
Programming: Putting Together the Pieces Built-in Functions and Expressions Alice.
Introduction to Alice Alice is named in honor of Lewis Carroll’s Alice in Wonderland.
Class-level Methods Chapter 6 part 1. Classes and Objects Classes o In Alice, classes are predefined as 3D models Objects o An object is an instance of.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
Motion and Rotation. 3 Dimensional Space  An Alice object o Is located in a 3D world, positioned at (x, y, z) o has 3 dimensions o height, width, depth.
Creating An Animation Program Part 2 Alice. Method A segment of program code (instructions) that defines how to perform a specific task.
Don Slater Wanda Dann Joint Operations Copyright 2012 Wanda Dann, Don Slater All rights reserved.
Learning to Program with Alice – Chapter 1 September 16, 2009.
CS329e – Elements of Visual Programming Implementing Programs Mike Scott (Slides 2-2)
A first program Sept 14, 2010 – Day 3 Object-oriented Programming thru Video Games TIDE 1840 Harry Howard Tulane University.
Introduction to Alice Alice is named in honor of Lewis Carroll’s Alice in Wonderland.
Obj: Introduction to Alice HW: Read handout and answer questions. Alice is named in honor of Lewis Carroll’s Alice in Wonderland Day 5.
Programming: Putting Together the Pieces Built-in Questions and Expressions Alice.
Introduction to Alice Alice is named in honor of Lewis Carroll’s Alice in Wonderland.
Programming: Putting Together the Pieces Built-in Functions and Expressions Alice.
Functions Sec 8-11 Web Design. Objectives The Student will: Understand what a function is Know the difference between a method and a function Be able.
Copyright 2008 Wanda Dann, Steve Cooper, Don Slater Alice Workshop Functions, Loops, and Parameters.
Introduction to Alice Web Design Section 8-2 Alice is named in honor of Lewis Carroll’s Alice in Wonderland.
Programming: Putting Together the Pieces Built-in Functions and Expressions Alice.
CompSci 4 Starting Alice Jan 15, 2009 Prof. Susan Rodger Alice is named in honor of Lewis Carroll’s Alice in Wonderland.
CompSci 4 Starting Alice Sep 2, 2010 Prof. Susan Rodger Alice is named in honor of Lewis Carroll’s Alice in Wonderland.
Objective You will be able to define the basic concepts of object-oriented programming with emphasis on objects and classes by taking notes, seeing examples,
Chapter 1: Introduction to Alice and Objects
Programming in Alice IT-IDT-9 Design, develop, test and implement programs using visual programming. 9.1 Utilize drag and drop software to develop programs.
Setting Up the Initial Scene. Problem Solving in Alice Set up the initial scene in a new world The princess example Setting up the initial scene.
1 Quiz Show Programming Terms. 2 Alice - 3D Virtual Programming Vocabulary Quiz Board Chapter 1 Chapter 2a Chapter 2b Chapter 3 Chapter 4 $100 $200 $300.
CS0007: Introductory Programming Rotational Motion.
Motions and Animation CS 110 – Honors Slides by Wanda Dann, Ithaca College.
Objects in Alice.
Programming: Putting Together the Pieces Built-in Functions and Expressions Sec 8-5 Web Design.
Setting Up the Initial Scene
CS320n – Elements of Visual Programming
Obj: Introduction to Alice
Introduction to Alice Alice is named in honor of
Alice Concepts.
Introduction to Alice Alice is named in honor of
Introduction to Programming
Introduction to Alice Alice is named in honor of
Programming: Putting Together the Pieces Built-in Functions and Expressions Alice.
Introduction to Alice Alice is named in honor of
Programming: Putting Together the Pieces Built-in Functions and Expressions Alice.
Programming: Putting Together the Pieces Built-in Functions and Expressions Alice.
Programming: Putting Together the Pieces Built-in Functions and Expressions Alice.
Alice Concepts.
Introduction to Alice Alice is named in honor of
Programming: Putting Together the Pieces Built-in Functions and Expressions Alice.
Programming: Putting Together the Pieces Built-in Functions and Expressions Alice.
Introduction to Alice Alice is named in honor of
Programming: Putting Together the Pieces Built-in Functions and Expressions Alice.
Introduction to Alice Alice is named in honor of
Presentation transcript:

Objects and Object-Oriented Programming CS 110 – Honors Slides by Wanda Dann, Ithaca College

Objects 4 What is an object ? –any thing that can be identified as unique from other things 4 How is an object identified as unique? –has a name –has properties: width, height, color, location, age, ss#, id# –has a purpose: associated actions it can perform tasks it can carry out

Class 4 Objects are categorized into classes 4 Each object is an instance of the class. 4 All objects in a class have similar properties and generally can perform the same tasks. Person Dogs Peter Mary Paul Spike Scottie Fluffy

Objects in a Virtual World 4 In Alice, each 3-D model is an object –has a unique name Bunny, Bunny1, Bunny2 –has color(s) Pink, White, Grey, Black, Blue, …. –has 3 dimensions height, width, depth

Object Orientation 4 Each object has 6 degrees of orientation –front, back, left, right, up, down 4 Orientation is relative to the object itself –Bunny.move(left, 1, …) is a move to the Bunny's left 4 But, an object is aware of its orientation relative to other objects –Bunny.pointAt(Helicopter)

3-D Space 4 An object is located in 3-D space x y z x is left - right y is up - down z is front - back (0,0,0)

Repositioning 4 Movement of an object changes its position in space. 4 Some movements are translational –Bunny.move(back, 0.5, …) 4 Other movements are rotational –Bunny.turn(left, 0.5, …)

Motion Distance 4 Translational Distance –1 unit is about 1 meter (relative to the Virtual World dimensions) 4 Rotational Distance –1 unit is 1 rotation (360 degrees -- full turn) 4 Can specify –fractional parts of a unit 1/2 0.5 –multiple units 2

Instructions 4 An instruction such as Bunny.move(left, 1, …) is a statement that asks an object to perform an action or carry out a task. 4 Instructions must follow certain rules of syntax objectName.actionName(argumentList) 4 Note: –Instructions may have 0, 1, 2, … or more arguments –Some arguments are optional, some are required

Time 4 Animation takes time -- even on fancy computers! 4 By default, executing an instruction in Alice takes 1 unit of time (approx. 1 second) 4 You can specify the amount of time Bunny.move(left, 1, duration = 2) Note: This instruction would slow down the move -- how could you speed it up?

Object Parts 4 Many objects are made up of parts (we say they are composites) 4 A part of an object moves –with the entire object, by default –on its own, if given a specific instruction Bunny.head.leftear.turn(down, 1/8) –Syntax: objectName.partNameList.actionName(argumentList)

Object-Oriented Programming 4 An Alice program is: –a scene containing stationary objects -- like props on a stage active objects -- will move around the scene –a list of instructions that ask the objects to perform tasks in the virtual world 4 So, an Alice program is object-oriented.

Reading and Lab 4 See handouts. 4 Note: Lab exercises and projects require that you show me the code and execution of the programs created. I must "initial" your lab sheet for the exercises and projects or you will not get credit for them!