Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   Detect click on object in array? (http://www.alice.org/community/showthread.php?t=7475)

CraigGraham 10-31-2011 03:22 PM

Detect click on object in array?
 
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.

dakota95 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.


All times are GMT -5. The time now is 11:47 AM.

Copyright ©2021, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.