Alice Community  

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

Thread Tools Display Modes
Detect click on object in array?
Junior Member
Status: Offline
Posts: 6
Join Date: Oct 2011
Location: UK
Default Detect click on object in array? - 10-31-2011, 03:22 PM

In Alice2.2, after creating an array or list of "bad guy" objects, is there a way to detect mouse clicks over a member of the array rather than having to add a "when mouse is clicked on.." event by hand for every "bad guy" object?

I'd like to be able to have things coming towards the camera and be able to bash them back by clicking them with the mouse, and then be able to add more as time goes on.

I can do this in Alice3 (though not add more objects on the fly- but there's ways round that) but the lack of documentation and examples prompted me to drop to 2.2 where I can't seem to do any event binding via a forAll loop and fall at the first hurdle.
Reply With Quote
Senior Member
dakota95's Avatar
Status: Offline
Posts: 426
Join Date: Aug 2011
Location: like I would tell you. ;)
Cool 11-02-2011, 01:24 PM

I've tryed a lot of different ways but I cannot get it to work. The way that I normally do it is I just have individual ones. If you are wanting the guys to do something after you click on them, then what I suggest would be to make what you want the first guy to do and then copy it into all of the other guys. So just make methods for each guy and copy from one guy to the next.
Reply With Quote

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 ©2021, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.