Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How Do I? (http://www.alice.org/community/forumdisplay.php?f=28)
-   -   How do you use CollisionListeners? (http://www.alice.org/community/showthread.php?t=9899)

yzhang 02-05-2013 09:40 AM

How do you use CollisionListeners?
 
I was trying to implement CollisionListeners in my program. I have created an array of boulders and wanted Alice to check collision when the user navigates around using the arrow keys, but couldn't figure out how collision listeners work. I did see that when a collisionlistener is added, it takes the existent arrays in my program as its argument.

Also orignailly I planned to use castle walls. But somehow, those castle walls can't be put into an array.

djslater107 02-06-2013 07:35 AM

Collision Listeners
 
These are still in development, so I am glad to hear where you are finding issues that we need to look at...

Right now, you need two sets of arrays, an array of "colliders" and an array of "collide-ables"... It may be that the two arrays contain some or all of the same objects, but if you have a character that is not in one of the arrays, than that character will not be part of the collision listening...

If you have set it up in this way, and it is still not working, send me a copy of your world (don@alice.org).

I am surprised castle walls do not work... I cannot think of any reason why they should not...

Thanks...

Alex001 02-11-2013 06:31 AM

re
 
My plan is to detect which two bodies collided in the contact listener by ... array list and finally use the update handler to remove these bodies.


All times are GMT -5. The time now is 07:17 PM.

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