Alice Community  

Go Back   Alice Community > General Discussion > Questions and Comments

Reply
 
Thread Tools Display Modes
I need a little help...
Old
jrrTolkien
Senior Member
 
jrrTolkien's Avatar
 
Status: Offline
Posts: 166
Join Date: Feb 2014
Location: Middle-Earth (Merrimack, NH)
Red face I need a little help... - 05-08-2014, 12:48 PM

I have been using Alice for several years now, and have been posting answers to many people's questions, but now I have a question that needs answering! I have had experience with most code in Alice, but I don't know what the "for" statements do. The "for all in order" and "for all together" are the ones that I mean. I know that it has something to do with the lists, because it wants you to specify one when you drag it in, and that the for all in order plays the code in that order, and the all together plays them at the same time, but I don't know what the list is used for. If anyone can help with that, please do! Thanks,

-Jrr
   
Reply With Quote
for all together, for all in order
Old
djslater107
Administrator
 
Status: Offline
Posts: 190
Join Date: Jan 2007
Default for all together, for all in order - 05-09-2014, 07:05 AM

You are correct... These statements are for lists...

Assume you have a list of cars, for a racing game. You will use the move command, with a random distance traveled.

For all together will have each car in the list move at the same time, but each for a difference distance. You build this statement by dragging in the move command for one of the cars, and then replace the car name in the move command with the "<obj> item from list" tile from the for all... statement. See attached screen shot.

All cars in the list will move at the same time, but with different random distances...

For all in order works the same way, but each car will move one after another (in the order they were added to the list)...

I hope that this helps...
Attached Images
File Type: jpg forAllTogether.jpg (18.4 KB, 14 views)


Don Slater
Alice Team
Carnegie Mellon University
   
Reply With Quote
Reply

Thread Tools
Display Modes

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 Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.