View Full Version : How do you use CollisionListeners?

02-05-2013, 09:40 AM
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.

02-06-2013, 07:35 AM
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...


02-11-2013, 06:31 AM
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.