View Single Post
Identical click behavior for a group of objects
Old
ohioboater
Junior Member
 
Status: Offline
Posts: 5
Join Date: Apr 2014
Default Identical click behavior for a group of objects - 04-25-2014, 05:01 PM

Apologies if this is an obvious question. My son has a world with 6 buildings in it. For 5 of those buildings, if the user clicks on the building, the world should display a message that the building is locked. He knows how to do this with a series of nested if/else statements, but is there a more elegant way to do this? His idea was to have a list of buildings, and when an object is clicked, check to see if that object is a member of that list. But that doesn't seem to be the way lists/arrays work in Alice. But then I'm learning this along with him, so I could very well be missing something.

This is in Alice 2. We've been using the Duke tutorials and the Dann/Cooper/Pausch textbook.
   
Reply With Quote