Alice Community  

Go Back   Alice Community > Alice 2 > Works-In-Progress

Reply
 
Thread Tools Display Modes
calling a method to list gathered objects
Old
mhegin01
Guest
 
Status:
Posts: n/a
Default calling a method to list gathered objects - 11-26-2010, 04:56 PM

I have made a program for gathering certain objects. When objects are clicked on, the user is asked if the object should be taken. It true, the object's isShowing property is set to false, thus making it disappear. The first problem I am having is getting the program to not make the object disappear if the user answers no to the question. My second problem is, how do I set up a method to have my guy say only the objects whose isShowing property is set to false. I have attached what I have done so far. This is my term project, so I don't want the answers necessarily. I just wondered if someone could point me in the right direction. I have tried everything I can think of. I have attached the code that I have so far.

Last edited by mhegin01; 11-26-2010 at 07:40 PM. Reason: Sorry, file didn't attach.
   
Reply With Quote
Old
zonedabone
Senior Member
 
zonedabone's Avatar
 
Status: Offline
Posts: 578
Join Date: Nov 2008
Location: In the interwebs
Default 11-29-2010, 04:56 PM

I'm guessing that you made an if function in order to ask the user that question. If not, try making one and making that the condition. Now, make yourself a list variable. In the true part of the list, hide the object and add it to the list.


'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
populating a list
Old
mhegin01
Guest
 
Status:
Posts: n/a
Default populating a list - 12-02-2010, 10:04 AM

I have solved my first issue, but I still haven't figured out how to add items to an empty list and call a method that will have my guy say the items that are in the list.
   
Reply With Quote
Old
haven812
Guest
 
Status:
Posts: n/a
Default 12-03-2010, 05:36 PM

To add an item to a list, drag the list variable into the method, and select the add item to the end of list (I think it is called this, I use java style). To make the person say the items in the list, drag a for all in order tile into the method editor, and select the list that you added the objects to. In that tile, drag a person say method into it and make him say the object from list as a string.
   
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 ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.