View Full Version : 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.

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.

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.

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.