Alice Community Chapter 9 Exercise 1 The Wave

 Chapter 9 Exercise 1 The Wave
 chunter Guest   Status: Posts: n/a Chapter 9 Exercise 1 The Wave - 04-22-2010, 03:12 PM I have set the animation up with the coach, student1, skaterGirl, and randomGuy2. I am using For all in order and a world variable list. The problem I have is the skateGirl and randomGuy2 does the wave with arm forward movement. The coach and student1 does the wave with arm left movement. How can I get all of them to use they same movement type so I can use one variable with all four of them in a list?
 Problem Correct
 chunter Guest   Status: Posts: n/a Problem Correct - 04-22-2010, 04:36 PM I found the problem.
 poolebj Junior Member   Status: Offline Posts: 4 Join Date: Apr 2012 05-07-2012, 10:06 PM What was the problem? I'm having the same issue
 shan841 Junior Member   Status: Offline Posts: 1 Join Date: Nov 2014 12-15-2014, 10:43 AM Curious how others did this?? The only way I could make this work was to create two different lists/methods, one for skatergirl & random guy, and another for coach & student.
 chickentree Super Moderator   Status: Offline Posts: 250 Join Date: Dec 2012 Location: Frosno, Ca Bad problem - 12-15-2014, 08:04 PM IMHO this is a terrible problem. What it says and implies by the picture is that these objects can all be programmed in a list to do the wave. The problem is, as you pointed out, that if you try and use the characters shown, it will never work. The reason it does not work is that the objects are not all built the same so that the steps in getting one object to wave is not the same as getting another one to wave. This is not to say that all the characters have to be the same type of object, just that they need to be structured the same. If you look at the coach, he has a his arms attached to his upper body and each arm has a hand sub-object. The Random Girl 1, by contrast, has shoulder sub-objects directly beneath the main object. In addition, the sub-objects are arm->forearm->hand. And the Random Guy 1 is different than either of the objects above he has arms coming off his upper body (like the coach) but the arms consist of arm->elbow->forearm->hand. In short there is no sane way to program Alice using lists because the sequence of sub-objects from the main character to its hand are different. While you could write a method that test for the type of object and executes different instructions for each type, that kind of defeats the purpose of the exercise. Mark Mark Henwood mhenwood@ieee.org
 Or a Good Challenge
MrMoke
Senior Member

Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Or a Good Challenge - 12-16-2014, 10:31 AM

A few of the important things I’ve learning over the last 47 years or so of programming is to master the language you are using, and use it creatively through experimentation.

One of the things that Alice2 objects have in common is the ability to use Poses that you have captured during the design phase of your project. In this instance, we have a fixed number of objects, so the objects and poses can be stored in “either Lists or Arrays” and they will work the same when referenced with a single index value.

Your job is to think beyond drag-and-drop, and instead build the project “Before” you start coding. If you were standing up and wanted to wave to someone, how many unique positions (aka: poses), including repeatable, would be needed? Now use your mental list of positions to build those poses into each character. The only thing finite here is the step count, not the poses, so the waves don’t have to look the same.

Once complete you can use loops to activate the poses on the items in the Object and Pose arrays. This can be done in straight-line code, or using mouse-click events where the object clicked is passed in as a parameter.

The attached demo is small example. Note that the setup time was much longer than the coding phase. My finished project is much more sophisticated. Have fun and remember that your C.O. might be watching
Attached Files
 WaversDemo.a2w (3.05 MB, 4 views)

Last edited by MrMoke; 12-16-2014 at 10:40 AM.

 Thread Tools Display Modes Hybrid Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements     Community News and Announcements Alice 3     How Do I?     Works In Progress     Share Your World     Share Custom Classes     Bugs and Trouble Shooting     Suggestion Box Alice 2     How do I...?     Works-In-Progress     Share Worlds     Share Objects     Bugs and Troubleshooting     Suggestion Box Educators     Teaching with Alice     Teaching Using Alice 3     Teaching Using Alice 2     CS Principles and Alice     AP CSA and Intro to Java and Alice     Workshops General Discussion     Questions and Comments     The Lounge