CS329e – Elements of Visual Programming Implementing Programs Mike Scott (Slides 2-2)

Slides:



Advertisements
Similar presentations
Mike Scott University of Texas at Austin
Advertisements

Getting Started With Alice By Ruthie Tucker under the direction of Prof. Susan Rodger Duke University, July
Introduction to Alice Alice is named in honor of Lewis Carroll’s Alice in Wonderland Modified by Serita Scott Further modified by Suzy Crowe.
Princess & Dragon Part 2: Teaching a Dragon to Fly—Methods & Properties By Elizabeth Liang under the direction of Professor Susan Rodger Duke University.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.
Lights Camera Action! Part 3: BDE Events By Deborah Nelson under the direction of Professor Susan Rodger Duke University July 2008.
Programming in Alice Chapter 2. Today’s Agenda Designing a Program Writing Methods Executing Instructions Simultaneously Comments Tips for Setting Up.
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.
CS320n –Visual Programming Functions Mike Scott (Slides 6-1) Thanks to Wanda Dann, Steve Cooper, and Susan Rodger for slide ideas.
CS320n –Visual Programming Interactive Programs Mike Scott (Slides 5-1)
Programming in Alice Chapter 2 Part 2. Events Editor Identifies what method is executed (run) when the “Play” button is hit 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.
Creating a 3D Interactive Story Prof. Susan Rodger Duke University Feb. 24, 2007.
Alice Learning to program: Part 1 Scene Setup and Starting Animation by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke.
Calvin and Hobbes Teach Properties and Functions Created by Daniel MacDonald under the direction of Professor Susan Rodger Duke University June 2013.
Alice Learning to program: Part Two by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2008.
Princess & Dragon Part 4: Breathing Fire—Adding Effects to Alice By Elizabeth Liang under the direction of Professor Susan Rodger Duke University June.
Creating An Animation Program Alice Web Design Section 8-4.
Classes, Objects, and World-level Methods
Programming Logic Program Design. Objectives Steps in program development Algorithms and Pseudocode Data Activity: Alice program.
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.
by Chris Brown under Prof. Susan Rodger Duke University June 2012
CS320n –Visual Programming Introduction to Alice Mike Scott (Slides 2)
Getting Started With Alice By Ruthie Tucker under the direction of Prof. Susan Rodger Duke University, July
Skater World: Part Two By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
Introduction to Arrays. definitions and things to consider… This presentation is designed to give a simple demonstration of array and object visualizations.
Alice 2.0 Introductory Concepts and Techniques Project 1 Exploring Alice and Object-Oriented Programming.
Creating An Animation Program Part 2 Alice. Method A segment of program code (instructions) that defines how to perform a specific task.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming First Edition.
Animation Programs: Scenarios and Storyboards Alice.
Xin Nov 15, Introduction to Alice Alice A very visible programming language Programming by dragging objects Interface World window The virtual world.
Alice Program Design and Implementation. Scenarios and storyboards The previous magician example illustrated a simple storyboard which depicts a scenario.
What we will do today Learn about functions in Alice.
An Introduction to Alice (Short Version) – Extras! Yossra Hamid Under the Supervision of Professor Susan Rodger Duke University, June 2014 This is a continuation.
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.
Storyboarding1 Steve Cooper Barb Ericson August 2009 Storyboarding.
Creating An Animation Program Alice. Recall We began the animation creation process We introduced the concept of storyboard We will continue using the.
Skater World: Part Two By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June 1,
Animation Programs Alice.
Alice Learning to program: Part Two Writing Your Own Methods by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke University,
Bunny Eat Broccoli Repetition – Simple loops and Conditional loops Susan Rodger Duke University July 2011.
Creating an Animation Program
CS320n –Visual Programming Classes, Objects, and World- Level Methods Mike Scott (Slides 4-1)
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,
Creating a 3D Interactive Story Prof. Susan Rodger Duke University July 19, 2007.
Fall 2007ACS-1805 Ron McFadyen1 Chapter 2 Creating Your First Animation (An Introduction to Programming)
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.
Creating an Animation Program Alice. The programming steps.
Animation Programs: Scenarios and Storyboards Alice.
Presenter: Carol Liss Timberlane Regional Middle School 6 th and 7 th grade Tech. Educator Co presenters:
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.
Chapter 2: Programming in Alice
Beginning Animation. Storyboard An Invitation to Dinner 1.Marlin and Dory (two small fish) are swimming and talking. 2.A shark (Bruce) swims up behind.
Programming in Alice Chapter 2.
Animation Programs: Scenarios and Storyboards
Classes, Objects, and World-level Methods
Getting started in Alice
Introduction to Events
Learning Java with Alice 3.0 Game Design Kathy Bierscheid
Classes, Objects, and World-level Methods
Creating an Animation Program
Animation Programs: Scenarios and Storyboards
Chapter 2: Programming in Alice
Creating an Animation Program
Classes, Objects, and World-level Methods
Creating An Animation Program
Presentation transcript:

CS329e – Elements of Visual Programming Implementing Programs Mike Scott (Slides 2-2)

Elements of Visual Programming Implementing Programs2 What We Will Do Today Cover how to implement a program after the storyboard is created Work on examples in the lab: –Exercise 2.4 on page 48. Circling Fish –Exercise 2.5 on page 48. Tortoise Gets Cookie Answer questions about assignment 1

Elements of Visual Programming Implementing Programs3 Last Time Given a problem we want to solve it by creating an animation Create storyboard / script –snowman example –bike race example

Elements of Visual Programming Implementing Programs4 Initial Scenes

Elements of Visual Programming Implementing Programs5 Initial Scenes

Elements of Visual Programming Implementing Programs6 Techniques and Tools Mouse used to –set up the initial scene –approximately position objects in the scene –resize and rotate objects Camera Navigation is used to –set the camera point of view Drop-down menu methods are used to –resize objects and rotate objects –more precisely position objects in the scene Scene Editor's Quad View is used to –obtain specific alignments –position one object relative to another object

Elements of Visual Programming Implementing Programs7 Writing A Program "Writing" a program (script) – a list of instructions to have the objects perform certain actions in the animation Our planned story board (to do list) is Snowman turns to face snowwoman Snowman blinks and addresses snowwomen Snowwoman turns around Now translate design steps into program instructions

Elements of Visual Programming Implementing Programs8 Translating the Design Some steps in the storyboard can be written as a single instruction –The snowman turns to face the snowwoman Other steps are composite actions that require more than one instruction Snowman blinks and addresses snowwomen blinks -> Snowman raises and lowers his eyes addresses -> Snowman says “ahem”

Elements of Visual Programming Implementing Programs9 Actions Sequential –Some actions occur one after the other first step (snowman turns to face snowwoman) second step (snowman tries to get snowwoman’s attention) Simultaneous –Other actions occur at the same time Snowman says "Ahem" and while simultaneously blinking his eyes

Elements of Visual Programming Implementing Programs10 Action Blocks in Alice Sequential Action Block Simultaneous Action Block

Elements of Visual Programming Implementing Programs11 Writing the Program In Simple Animations notice the only event world.my first method world is an object (contains all other objects) my first method is a method. A behavior of a certain objects methods consist of a series of instructions and commands (some of which may be other methods…) –big rocks into little rocks

Elements of Visual Programming Implementing Programs12 Adding Instructions to world.my first method The method should be open in the method editor window of Alice. (bottom right) –if not select the world from the object tree, the method tab, and click the edit button next to my first method

Elements of Visual Programming Implementing Programs13 Method Editor Window

Elements of Visual Programming Implementing Programs14 Step 1 – Snowman turns Select the object you want to perform the object Select the method / action you want the object to perform –could use turn or turn to face –often many ways to accomplish the same task Click and drag it to the method editor window

Elements of Visual Programming Implementing Programs15 Snowman Turns Can adjust aspects of how the snowman turns to face the snowwoman –click the more option –right now duration and style are the only things you should alter

Elements of Visual Programming Implementing Programs16 Step 2 – Combined Action We want the snowman to say “ahem” and blink at the same time actions are normally sequential to do actions together, at the same time, use a “Do together” block Click and drag “Do together” block into the method

Elements of Visual Programming Implementing Programs17 Step 2 – Combined Actions Now drag the things we want to happen together into the “Do together” block Snowman say ahem Snowman blink – raise and lower eyes

Elements of Visual Programming Implementing Programs18 Affecting subparts The snowman does not have “blink eyes” method Can accomplish a blink by affecting subparts Select snowman object from object tree and expand subparts –expand the head –now we can give commands to individual parts, in this case the eyes –have eyes move up and down –specify direction and distance of move

Elements of Visual Programming Implementing Programs19 Step 2 – First Attempt world.my first method looks like this TEST the method –play the movie. Does it do what we want?

Elements of Visual Programming Implementing Programs20 Logic Error The program works, but does not do what we intended. –This is an example of a logic error –very easy in Alice to see logic errors –the movie does not do what we wanted What’s the problem?

Elements of Visual Programming Implementing Programs21 Do together and Do in order All commands in the Do together block are executed simultaneously So what is the result if you move an eye up.1 meters and down.1 meters at the same time? –Apparently nothing So while we want the eyes to move together and to say “ahem” we want the eyes to first move up and then down Use a Do in order block inside the Do together block

Elements of Visual Programming Implementing Programs22 Corrected Do Together

Elements of Visual Programming Implementing Programs23 Testing An important step in creating a program is to run it – to be sure it does what you expect it to do. We recommend that you use an incremental development process: write a few lines of code and then run it write a few more lines and run it write a few more lines and run it… – This process allows you to find any problems and fix them as you go along. As you go you may alter your design / storyboard design a little, code a little, test a little…

Elements of Visual Programming Implementing Programs24 Comments While Alice instructions are easy to understand, it is often desirable to be able to explain (in English) what is going on in a program We use comments to explain to the human reader what a particular section of code does

Elements of Visual Programming Implementing Programs25 Comments Notes: 1) Comments appear in green 2) Alice ignores comments. 3) Comments make the program easier to read.

Elements of Visual Programming Implementing Programs26 Extra – Moving Together To move things together can sometimes be a pain Tell two objects to move “forward” –directions are relative to the objects –may get motion in different directions can use the “orient to” method to synch frames of reference

Elements of Visual Programming Implementing Programs27 Vehicles Each object has a vehicle property Initially the world is the vehicle for objects can change this by altering the vehicle property for an object Give the snowman an instrument Change “ahem” to “toot” What happens when movie played?

Elements of Visual Programming Implementing Programs28 Alter the Vehicle Property Select sax from object tree Select properties tab Change vehicle from world to snowman