Alice Community Completely lost.....

 Completely lost.....
 MSU4Life Guest   Status: Posts: n/a Completely lost..... - 02-07-2009, 11:28 AM New to Alice, had a in my lab for the class the other day and now 3 days after I failed to complete the work in class I am still racking my brain. This is no longer for a grade, only for future reference. Our TA designed a program that had a kangaroo hop twice and land on a box. The initial distance from the kangaroo to the box is set to 6 meters. Each hop covers 2 meters and the landing covers 2 meters. I have to create a variable that allows the hops and landing to cover the right distance regardless of the position of the box from the kangaroo. Any help would be greatly appreciated.
DrJim
Guest

Status:
Posts: n/a
02-07-2009, 08:43 PM

Actually not a trivial problem, though it looks easy at first glance. Perhaps the attached will help - though don't be surprised if it doesn't work without some tweaks. Also don't hesitate to ask your TA for help.

The variable part is simple in principle - just use the distance to function divided by three. Catch 1 - "distance to" is always measured from an objects local axis origin - which is defined differently for different objects - so make sure you know where that point is for the pair of objects you are using.

Catch 2 - you need to use the "turn to face" command rather than the point at command if you are going to use the "move forward" command. The Dunn, et al text has a nice example showing the difference.

Catch 3 is similar to the first - you need to make sure that the up directions for the two objects is the same. (It really doesn't matter for the cube - but does if you use the box shape or something similar.)

Good luck.
Attached Files
 Kanga Hop.a2w (364.9 KB, 44 views)

 Thread Tools Display Modes Linear 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