Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Alice Workshop Implementation Algorithm  Code World.my first method Control blocks Statements (methods,

Slides:



Advertisements
Similar presentations
Mike Scott University of Texas at Austin
Advertisements

Adventures in Animation Alice – Advanced! Michelle Venable-Foster June 2006.
Alice.
Don Slater Wanda Dann
Implementation with procedural methods. Recall: Step 3 Write statements (code) – a few steps at a time, not the entire program at once! Problem Statement.
Class-level Methods and Inheritance MMP 220 Multimedia Programming This adapted material was prepared for students in MMP220 as as part of a curriculum.
Princess & Dragon Part 2: Teaching a Dragon to Fly—Methods & Properties By Elizabeth Liang under the direction of Professor Susan Rodger Duke University.
Lesson 7B Creating Our Own Methods Slides are adapted from aliceprogramming.net or
Don Slater Wanda Dann
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.
Exam Wednesday No inclass assignment this week. Friday labs will help with individual homework assignment due Friday midnight Review for exam –Tuesday.
Alice Programming Step 1:Design Copyright 2011 Wanda Dann, Don Slater, Steve Cooper.
Programming in Alice Chapter 2. Today’s Agenda Designing a Program Writing Methods Executing Instructions Simultaneously Comments Tips for Setting Up.
Programming in Alice Chapter 2 Part 2. Events Editor Identifies what method is executed (run) when the “Play” button is hit 2.
Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Alice Workshop Problem Solving with Alice 2 & Friends.
Classes, Objects, and World-level Methods Alice. Programming in Alice© 2006 Dr. Tim Margush2 Class / Object Class A template describing the characteristics.
Alice: A Free 3D Animation World for Teaching Programming Barbara Ericson Georgia Institute of Technology Oct 2005.
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.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley This week: Whew!!! The last homework was tough! The homework for this week.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
by Chris Brown under Prof. Susan Rodger Duke University June 2012
Making a Timer in Alice.
Making a Boat Racing Game in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2010.
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.
Playing Music in Alice By David Yan Under the direction of Professor Susan Rodger July 2015.
Alice Programming Step 1:Design Copyright 2011 Wanda Dann, Don Slater, Steve Cooper.
Alice 2.0 Introductory Concepts and Techniques Project 1 Exploring Alice and Object-Oriented Programming.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming First Edition.
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.
By Deborah Nelson Duke University Professor Susan Rodger July 13, 2008.
Playing Music in Alice By David Yan Under the direction of Professor Susan Rodger July 2015.
Lesson 9B Adding sound and Billboards. What is a function? Give an example. How do you create a method? Give an example. What is an event? Give examples.
Lists Tutorial By Deborah Nelson Duke University Professor Susan Rodger July 13, 2008.
Making a Timer in Alice By Jenna Hayes under the direction of Professor Susan Rodger Duke University July
Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Alice Workshop Welcome & Introduction.
Don Slater Wanda Dann Copyright 2012 Wanda Dann, Don Slater All rights reserved.
Bunny Eat Broccoli Repetition – Simple loops and Conditional loops Susan Rodger Duke University July 2011.
CS320n –Visual Programming Classes, Objects, and World- Level Methods Mike Scott (Slides 4-1)
Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Alice Workshop More Precise Positioning Camera Marker One-shot methods Saving a world.
Review: the Dummy Marker Typically used for: Positioning large and small objects in a scene Remembering camera positions for multiple scenes Remembering.
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.
Copyright 2008 Wanda Dann, Steve Cooper, Don Slater Alice Workshop Functions, Loops, and Parameters.
Programming: Simple Control Structures MMP 220 Multimedia Programming This adapted material was prepared for students in MMP220 as as part of a curriculum.
Copyright 2008 Wanda Dann, Steve Cooper, Don Slater Alice Workshop Variables & Conditions.
ForLoopsInAlice1 Stephen Cooper Wanda Dann Randy Pausch Barb Ericson Oct 2009 Counted (For) Loops in Alice.
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.
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.
CS320n –Visual Programming Definite / Counted Loops (Slides 7-1) Thanks to Wanda Dann, Steve Cooper, and Susan Rodger for slide ideas.
Wanda Dann Don Slater Classes and Objects Copyright 2012 Wanda Dann, Don Slater All rights reserved.
Using Placeholders to Simplify your Methods: Learning Methods, Part 2 By Deborah Nelson Duke University Professor Susan Rodger June 16, 2008.
Wanda Dann Don Slater Methods Panel & Object Tree Copyright 2012 Wanda Dann, Don Slater All rights reserved.
An Introduction to Programming Using Alice 2.2, Second Edition Chapter 7 Recursive Algorithms.
Unit 2 Programming in Alice & Java 1. Day 1: Learning to Program  Objective: Understand the need for step-by-step logic; Basic working of a computer.
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.
Jonathon Kuo Under the Direction of Dr. Susan Rodger
Programming in Alice Chapter 2.
Alice 3 Using the Alice 3.1 Interactive Development Environment (IDE)
Changing Camera Views! Part 1: Set Point of View to By Bella Onwumbiko
The Alice Interface.
Repeating Actions.
Learning Java with Alice 3.0 Game Design Kathy Bierscheid
Classes, Objects, and World-level Methods
Michelle Venable-Foster Barb Ericson Jan 2007
Chapter 2: Programming in Alice
Princess & Dragon Part 2: Teaching a Dragon to Fly—Methods & Properties By Elizabeth Liang under the direction of Professor Susan Rodger Duke University.
An Introduction to Programming Using Alice 2.2, Second Edition
Classes and Objects Wanda Dann Don Slater
under the direction of Professor Susan Rodger
Presentation transcript:

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Alice Workshop Implementation Algorithm  Code World.my first method Control blocks Statements (methods, data, more)

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Next Step Problem Statement Understand the problem Implement the design Test the code Design a solution

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Load World  Why start with a standard world for active learning?  Load from: Presentations/Worlds 3-GoodVibrationsSetUp.a2w

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Do in order By default, statements in the code are performed in order, but you can also create a Do in order code block.

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Control Statements  Alice has two fundamental control statements  Do in order perform the actions in sequence  Do together perform the actions simultaneously

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater First action statement

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater 1. Select object  Start by selecting an object in the object tree (or click on the object in the scene)

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater 2. Select methods tab  In the details panel Tabs Properties  values of object properties Procedures  methods that perform an action Functions  methods that return a value

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater 3. Find method tile  Scroll down in methods tab

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater 4. Drag-n-drop Select data from drop-down menu… “turn to face” needs a target object

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Next Step Problem Statement Understand the problem Implement the design Test the code Design a solution

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Play (Run)  Click the Play button

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater World.my first method  When Play button is clicked, the world’s my first method is executed

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Modify  Alice allows some optional information to modify how an action is performed.  By default a statement in Alice runs in 1 second. The duration can be changed using more…

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Next action  Actually, several actions

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Method?  No “vibrate” tile?  Method tiles built-in to Alice are simple actions  Some models have complex actions defined, e.g., walk  For other complex actions, we may create our own

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Decompose  How can we create our own “vibrate” method?  Decompose a complex action into simple actions garfield.vibrate do together play vibrating sound do in order garfield move up a short distance, quickly garfield move down same distance, quickly

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Create a new method

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Name the method  Name should begin with a lowercase letter and have no spaces (use camelCase, if needed)

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater garfield.vibrate  New method tile and editor tab

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Number pad  Select “other” for number pad entry

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Duplicate  Hold Ctrl(Alt on Mac) and drag statement down to create a duplicate

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Modify  Click drop-down menu to select a different (argument) value

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Test Warning???

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Call the method  Alice must be given an instruction to perform the actions defined in the method.

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Test Does the action performed by garfield appear to be a vibration? Why or why not?

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Revise Design  An object that vibrates is oscillating in a rhythmic repetition  We need to repeat the action several times garfield.vibrate do together play vibrating sound repeat 5 times do in order garfield move up a short distance, quickly garfield move down same distance, quickly

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Loop  Drag in Loop control tile and select “5 times”

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Loop control block  Drag code statements into the Loop control block  A block of program code that repeats a counted number of times.

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Test Does the action performed by garfield appear to be a vibration? Why or why not?

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Revise #2  Play a sound at the same time…. garfield.vibrate do together play vibration sound loop 5 times garfield moves up a short distance, quickly garfield moves down same distance, quickly

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Import sound  World properties panel

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Imported file, timing

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Do together  Drag in do together code block

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Play sound

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Nested control blocks  Do in order inside do together

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Test  Are sound and vibration in sync?

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Wait  Useful for synchronizing sound and action

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Save  Be sure to save the world every half-hour, or so…

Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Textbook  More information  Coding Chapter 2, Section 2