Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Using lists
Old
sharpsm
Guest
 
Status:
Posts: n/a
Default Using lists - 12-22-2009, 06:16 PM

Hi I'm doing the Marching Band routine for an assignment. I've already made a list of 4 toy soldiers but how do I get them to perform a task all at the same time such as walk forward. I can't figure out how to make a method and put in the whichSoldier parameter into it
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 12-22-2009, 07:01 PM

Which part do you not understand, the parameter part of the method, or making the method include all of the objects in your list at the same time?

Post your world and I can see if I can do it.


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301

Last edited by Dameria; 12-22-2009 at 07:05 PM.
   
Reply With Quote
Old
sharpsm
Guest
 
Status:
Posts: n/a
Default 12-22-2009, 08:34 PM

ok i know how to make the parameter my problem lies with creating the method using that parameter here is what I have so far. All I really need is a way to make them move all together using a method. I don't know why I'm having so much trouble with this. It's quite embarrassing really
Attached Files
File Type: a2w Marching Band.a2w (1.89 MB, 86 views)
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 12-22-2009, 09:31 PM

Can't you just do a Do Together with all of the soldiers' methods like what I did below? Tell me if this is what you were looking for.
Attached Files
File Type: a2w Marching Band 1.1.a2w (1.89 MB, 165 views)


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
sharpsm
Guest
 
Status:
Posts: n/a
Default 12-22-2009, 09:45 PM

Yeah you could do that to but what I was looking for was a way to do that by using one command that would make all the soldiers in the list do it at the same time. I've provided a hint below that my instructor made for us. My problem is figuring out how to setup it all up.
Attached Files
File Type: zip MarchingBandHint.zip (16.0 KB, 133 views)
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 12-23-2009, 06:29 AM

Oh ok! Well yea now that you give me the exact script to use, I will definitely be able to do it for you. I have to go to school now though, so I will get it done in maybe 4 hours. Or if you understand, which I don't know if you will, just go to one of the drags on the bottom that says "For all together" and make it for the list soldiers. Then just put in every code you need inside of that for all together script. and replace which soldier parameters to the drag that is created from the For all together, it should be right there when you make it.

If you don't understand what I'm saying I can do it when I get home.


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 12-23-2009, 11:29 AM

Ahh nevermind I'm too lazy to do all that work. That "hint" actually tells you exactly what you have to put into the program. Just do whatever is on that hint paper and you should have it working.


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Variable for Marching Band
Old
NotMyBag
Guest
 
Status:
Posts: n/a
Default Variable for Marching Band - 01-31-2010, 09:12 PM

I created the variable for Marching Band which is a list of all Toy Soldiers.
I have completed all my code (methods for movement of one soldier).
When I drag the variable to replace that one soldier with the whole marching band (list), a drop down box appears asking for First Item from List, Last Item from List, Random Item from List, or ith Item from List. I have no idea what those are. All I want is the complete list to drop into the method instruction so that all soldiers will march at the same time.

Any suggestions on how to do this?

Right now my screen shows For All Together, Do In Order, Loop (with methods).
   
Reply With Quote
Old
zonedabone
Senior Member
 
zonedabone's Avatar
 
Status: Offline
Posts: 577
Join Date: Nov 2008
Location: In the interwebs
Default 02-01-2010, 07:34 AM

Oh! Super mod made a typing error. He meant to say that you want to drag "item from marching band" from the top of the "For all together" method. This will automaticcally use all of the soldiers at once.


'Apple Macintosh' - An anagram of 'Complaints Heap'

M.A.C.I.N.T.O.S.H. - Machine Always Crashes, If Not, The Operating System Hangs.

You're *such* a mac person.
   
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.