Xin Liu Nov 24, 2010. Object-oriented programming A mimic of real world The world is composed of objects An object has some properties and methods and.

Slides:



Advertisements
Similar presentations
The Build-up of the Red Sequence at z
Advertisements

Objects and Properties Alice. Objects in Alice Objects already exist. Hundreds of them.
CSC1401 Animation Creating methods/instructions (class-level)
World-level Methods with Parameters Alice. Larger Programs As you become more skilled in writing programs, you will find that your programs quickly begin.
Skater World: Part Four By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June 2009.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.
TEAM SCARLET OPERATOR 1: Add Feet Mr. Potato Head A Mr. Potato Head C Mr. Potato Head B.
Classes, Objects, and World-level Methods Alice. Programming in Alice© 2006 Dr. Tim Margush2 Class / Object Class A template describing the characteristics.
Fall 2007ACS-1805 Ron McFadyen1 Chapter 4 OO Programming Concepts.
RATIOS OF SCALE DRAWINGS. SCALE DRAWINGS SCALE DRAWINGS: A scale drawing is a drawing that represents a real object. The scale of the drawing is the ratio.
Methods Tutorial: Part One By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June 9, 2008.
METHODS!.  A method is a sequence of instructions or behaviors that will be carried out when requested.  You can use them to create new methods so that.
Classes / Objects / Methods
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.
Classes, Objects, and World-level Methods
Today’s Agenda 1.Collect Pre-Lab 4 2.Alice Programming Assignment Storyboards 3.Classes 4.Objects 5.Methods 6.Assign pair programming teams and meet upstairs.
Classes, Objects, and World-level Methods Alice. Larger Programs As you become more skilled in writing programs, you will find that programs quickly increase.
Classes, Objects, and World-level Methods Section 47 Web Design.
Welcome! The Topic For Today Is…Review for Test. Your Topic Basics of Programming Control Statements Programming Concepts InteractionAlice Concepts 200.
Classes, Objects, and World-level Methods Alice. Larger Programs As you become more skilled in writing programs, you will find that programs quickly increase.
Skater World: Part Two By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June
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.
Alice 2.0 Introductory Concepts and Techniques Project 1 Exploring Alice and Object-Oriented Programming.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Xin Nov 15, Introduction to Alice Alice A very visible programming language Programming by dragging objects Interface World window The virtual world.
A first program Sept 14, 2010 – Day 3 Object-oriented Programming thru Video Games TIDE 1840 Harry Howard Tulane University.
Methods Tutorial: Part Two By Deborah Nelson Duke University Professor Susan Rodger June 16, 2008.
Now that the kangaroo and the turtle have raced, let's make a method for the kangaroo to hop back to the turtle and challenge him to a race again. Click.
L.O. To understand programming code, to navigate and add objects into Kodu. Start Menu  Primary Applications  ICT  Kodu.
Classes, Objects, and World-level Methods Alice. Larger Programs As you become more skilled in writing programs, you will find that programs quickly increase.
Definition of Object - Oriented Language.. Object-oriented programming (OOP) is a programming language model organized around "objects" rather than "actions"
Skater World: Part Two By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June 1,
Reductions, Enlargements and the Scale Factor Now if the red square is the original drawing, what is the blue square called? What is the yellow square.
Transformations Transformations of Functions and Graphs We will be looking at simple functions and seeing how various modifications to the functions transform.
Windows Movie Maker /6-12/Session 1 of 3 Workshop Title.
Why do we look the way we do? Snowman All of them are born with hats But some have tall hats and some have short hats.
Bunny Eat Broccoli Repetition – Simple loops and Conditional loops Susan Rodger Duke University July 2011.
CompSci 4 Chap 4 Sec 1 Sept 15, 2005 Prof. Susan Rodger.
Programming: Putting Together the Pieces Built-in Questions and Expressions Alice.
CS320n –Visual Programming Classes, Objects, and World- Level Methods Mike Scott (Slides 4-1)
Classes, Objects, and World-level Methods MMP 220 Multimedia Programming This adapted material was prepared for students in MMP220 as as part of a curriculum.
Creating a 3D Interactive Story Prof. Susan Rodger Duke University July 19, 2007.
Changing Camera Views! Part 1: Set Point of View to By Bella Onwumbiko under the direction of Professor Susan Rodger Duke University July 2013 Updates.
Skater World: Part Three By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June 2009.
Skater World: Part Four By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June 1, 2009.
Program Organization Sequential Execution: One line done after the other Conditional Execution: If a test is true, one section is done, otherwise another.
How to create a sprite Delete a sprite (e.g. the cat) by right clicking on it and choosing delete. Go to the bottom right hand corner and choose a new.
Chapter 1: Introduction to Alice and Objects
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.
Methods (part 1) Alice In Action, Ch 2 Slides Credit: Joel Adams, Alice in Action CS120 Lecture August 2012.
Using Placeholders to Simplify your Methods: Learning Methods, Part 2 By Deborah Nelson Duke University Professor Susan Rodger June 16, 2008.
What About Alice? In Alice, we have seen that we have:  Objects (skater, snowman, snowwoman, camera)  Methods (move, turn, roll, move toward)  Properties.
SEQUENCES. Introduction The symbols and words of Sequences n is a symbol used all the time in sequences n simply represents a counting number.
An Introduction to Programming Using Alice 2.2, Second Edition Chapter 7 Recursive Algorithms.
Variables and Inheritance Part 1 Alice. Review: Properties A class defines properties for its own kind of object. When an object is created (instantiated),
Xin Liu Dec 1, Sound Open lab6.a2w Import horseneigh.wav as a property Add the method “play sound” to horse.neigh Exercise Create a class-level.
Classes, Objects, and World-level Methods
Programming: Putting Together the Pieces Built-in Functions and Expressions Sec 8-5 Web Design.
Skater World: Part Four
Programming: Putting Together the Pieces Built-in Functions and Expressions Sec 8-5 Web Design.
Classes, Objects, and World-level Methods
Classes, Objects, and World-level Methods
Classes, Objects, and World-level Methods
Real World Dilation Math
OOP vs Structured Programming
Programming: Putting Together the Pieces Built-in Functions and Expressions Alice.
Programming: Putting Together the Pieces Built-in Functions and Expressions Alice.
Classes / Objects / Methods
Classes, Objects, and World-level Methods
Programming: Putting Together the Pieces Built-in Functions and Expressions Alice.
Presentation transcript:

Xin Liu Nov 24, 2010

Object-oriented programming A mimic of real world The world is composed of objects An object has some properties and methods and functions Components of OOP Classes The types/templates of objects Objects The instances of classes Different objects can be created from the same class The objects share the same methods but can have different names and properties Methods A method is an action that an object can take, actually composed of a sequence of instructions.

Exercise Create two objects from the camel class, named as Camelo and Camely. Camelo has red ears; Camely has blue ears. Camelo is bigger; Camely is smaller.

More on methods Build-in methods User-defined methods Class-level methods The actions of an object E.g. Iceskater.roll and Bunny.hop World-level methods The actions involving more than one objects E.g. World.Iceskater discusses with Snowman World.my first method is the “main program” we used to work on

Exercise Go through Tutorial 2.

Exercise Download and open lab4ggypt.a2w Create a class-level method on Pharaoh, getScared Beard enlarged by 1.2; nose enlarged by1.2; hat turns 1 rev; says “Aaaaah!” Create a world-level method, getScared Camera focuses on the Pharaoh Show the mummy scared Call world.getScared from world.myFirstMethod

Exercise Add a class-level method, getScared, to Mummy Head grows by 1.2 and then shrinks by 1/1.2; yells “Oooooh!” at the same time. Edit the world-level method, getScared Focus the camera to the mummy Call mummy.getScared Add a dummy object at the camera’s original position Edit the world-level method, getScared Turn the camera back

Summary Two class-level methods One world-level method A neat program is obtained by splitting the code into class and world-level methods