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.

Slides:



Advertisements
Similar presentations
CS320n –Visual Programming Class-level Methods and Inheritance – Part 1 Mike Scott (Slides 4-3-1) Thanks to Wanda Dann, Steve Cooper, and Susan Rodger.
Advertisements

Class-level Methods Alice. World / Class Method World method A general method that may refer to multiple objects; not closely associated with any particular.
Class-level Methods and Inheritance Part 1 Alice.
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.
Review of Chapter 4 Sections 1 and 2 World-level methods involve two or more objects break a large problem into smaller, logical units follow a design.
Class-level Methods and Inheritance Alice. Class-level Methods Some actions are naturally associated with a specific class of objects. Examples A person.
Class-level Methods and Inheritance MMP 220 Multimedia Programming This adapted material was prepared for students in MMP220 as as part of a curriculum.
CSC1401 Animation Creating methods/instructions (class-level)
Parameters and World-level methods Alice. Our Dragon world The dragon must to take off and fly, to carry the princess.
World-level Methods with Parameters Alice. Larger Programs As you become more skilled in writing programs, you will find that your programs quickly begin.
Parameters Alice.
Parameters Section 8-8 Web Design. Objectives The student will: Understand what a parameter is Understand how to use a parameter in Alice Understand how.
Alice: A Visual Introduction to Programming Chapter 1 Part 2.
Classes, Objects, and World-level Methods Alice. Programming in Alice© 2006 Dr. Tim Margush2 Class / Object Class A template describing the characteristics.
Animation Programs Alice. Overview 4-step process for creating animations Step 1: Understand Problem Step 2: Design Step 3: Implementation Step 4: Test.
Classes / Objects / Methods
Classes, Objects, and World-level Methods
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.
CS320n –Visual Programming Introduction to Alice Mike Scott (Slides 2)
Classes, Objects, and World-level Methods Alice. Larger Programs As you become more skilled in writing programs, you will find that programs quickly increase.
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.
Animation Programs: Scenarios and Storyboards Alice.
Alice 2.0 Introductory Concepts and Techniques Project 1 Exploring Alice and Object-Oriented Programming.
CS329e – Elements of Visual Programming Implementing Programs Mike Scott (Slides 2-2)
Teaching a character to walk in more than one world: Parameters and Inheritance. By Lana Dyck under the direction of Professor Susan Rodger Duke University.
Animation Programs: Scenarios and Storyboards Alice.
Alice: A Visual Introduction to Programming Chapter 1 Part 2.
Xin Nov 15, Introduction to Alice Alice A very visible programming language Programming by dragging objects Interface World window The virtual world.
What we will do today Learn about functions in Alice.
Classes, Objects, and World-level Methods Alice. Larger Programs As you become more skilled in writing programs, you will find that programs quickly increase.
Animation Programs 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.
Storyboarding and Program Design Alice. Step 1: Design Decide on the problem to be solved Design a solution We will use a storyboard design technique,
Today’s Agenda 1.Collect Pre-Lab 3 2.Alice Programming Assignment 3.Built-in Functions 4.Expressions 5.Control Structure 6.Assign pair programming teams.
Questions Alice. Functionality A question receives value(s), performs some computation on the value(s), and returns (sends back) a value.
Class-level Methods and Inheritance Alice. Class-level Methods Some actions are naturally associated with a specific class of objects. Examples A person.
World-level Classes Chapter 6 Part 2. Programs Grow Program code grows larger over time This makes it more difficult to read and process the code in our.
Lists Alice. Collections In some animations, several objects must perform the same actions Example: A marching band, where the band members are performing.
Creating An Animation Program Alice. Recall from last lecture We began the animation creation process We introduced the concept of storyboard We will.
Creating An Animation Program Alice. Recall We began the animation creation process We introduced the concept of storyboard We will continue using the.
Parameters Alice. A beetle band Our task is to create an animation for a bug band as an advertisement for their next concert.
Parameters Alice. Overview The need for more flexible methods Passing a parameter to a method Demos Using the Alice interface to write code for a parameter.
Parameters MMP 220 Multimedia Programming This adapted material was prepared for students in MMP220 as as part of a curriculum redesign project funded.
Creating an Animation Program Alice. The programming steps.
CompSci 4 Chap 4 Sec 3 Sept 23, 2010 Prof. Susan Rodger.
Animation Programs: Scenarios and Storyboards Alice.
Today’s Agenda 1.Collect Pre-Labs 2.Software engineering (CS 480) –Heavyweight approaches –Agile methods Extreme programming –Pair programming »PairDrawing.
Creating an Animation Program Alice. Step 1: Design Decide on the problem to be solved Design a solution We will use a storyboard design technique, commonly.
Class-level Methods and Inheritance Alice. Class-level Methods Some actions are naturally associated with a specific class of objects. Examples A person.
Animation Programs: Scenarios and Storyboards
Classes, Objects, and World-level Methods
Animation Programs: Scenarios and Storyboards
Parameters Section 8-8 Web Design.
Classes, Objects, and World-level Methods
Animation Programs: Scenarios and Storyboards
Classes, Objects, and World-level Methods
Classes, Objects, and World-level Methods
World-level Methods with Parameters
Parameters Alice.
Classes, Objects, and World-level Methods
Class-level Methods Alice.
Classes, Objects, and World-level Methods
Parameters and World-level methods
Animation Programs: Scenarios and Storyboards
Parameters Alice.
Classes, Objects, and World-level Methods
Class-level Methods and Inheritance
Class-level Methods and Inheritance Part 2
Presentation transcript:

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 for Lab 4

Explore the Possibilities CS 112: Foundations of Computer Science Classes, Objects, and Methods

Classes, Objects, & Methods Object-oriented programming uses classes, objects, and methods as basic programming components These components help to organize a large program into small modules

In our programs, we have been using… Classes Objects An object is an instance of a class. Class : Frog Objects : frog, frog1, frog2, frog3

Snowman Movie Do in order Catch Attention – snowman tries to catch the attention of the snowwoman Blink eyes – snowwoman turns to look and the snowman blinks his eyes Reactions – snowwoman blushes and turns away and the snowman is disappointed Movie Treatment in 3 scenes

Next Step The next step is to break down each scene into simpler steps – Example: Scene 1: Catch Attention Do in order snowman turns to face snowwoman snowman's head turns to face camera snowman says "Ahem" snowman's head turns to face snowwoman

Demo: Starting a new world-level method select the World tile in the Object Tree select the methods tab in the details area click on the "create new method" button

World-level methods scene1 is a world-level method because it is defined as a method for the World and has instructions that involve more than one object ( snowman, snowwoman, camera )

Parameters Movie treatment: beetle band tunes up

Stepwise Refinement Four scenes: e ach band member tunes up Do together Do in order georgeBeetle move up georgeBeetle move down play sound Do together Do in order ringoBeetle move up ringoBeetle move down play sound Do together Do in order paulBeetle move up paulBeetle move down play sound Do together Do in order lennonBeetle move up lennonBeetle move down play sound

Parameters tuneUp Parameters: bandMember, music Do together Do in order bandMember move up bandMember move down play music

Kinds of Parameters Alice provides several kinds of parameters that can be used in your own methods.

A Number parameter We could add a Number parameter to specify the height the bandMember jumps up and down. Note that the call to the method must now include an argument for the height.

Class-level Methods Some actions are naturally associated with a specific class of objects –A person walking – A wheel rolling –An iceSkater skating We can write our own methods to define an action for a specific class of objects -- a class-level method

Textbook Example Create a skate method for ice skater objects? We need to: (1)tell Alice to associate the new method (the one we are about to write) with an ice skater, and (2)write a new method to animate the ice skater skating.

First, to associate the animation with the ice skater select the iceSkater tile in the Object Tree select the methods tab in the details panel click on the create new method button

The slide actions each require several motion instructions, so we will break down these two actions into smaller steps Skate Do together move skater forward 2 meters Do in order slide on right leg slide on left leg

Creating a new class 1) Rename iceSkater as cleverSkater. 2) Save out as a new class. Alice saves the new class as CleverSkater.a2c

Importing CleverSkater An instance of the CleverSkater class can be added to a new world – use File|Import.