Alice Community  

Go Back   Alice Community > Alice 3 > How Do I?

Reply
 
Thread Tools Display Modes
How do you use CollisionListeners?
Old
yzhang
Junior Member
 
Status: Offline
Posts: 1
Join Date: Nov 2012
Default How do you use CollisionListeners? - 02-05-2013, 08: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.
   
Reply With Quote
Collision Listeners
Old
djslater107
Administrator
 
Status: Offline
Posts: 190
Join Date: Jan 2007
Default Collision Listeners - 02-06-2013, 06: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...

Thanks...


Don Slater
Alice Team
Carnegie Mellon University
   
Reply With Quote
re
Old
Alex001
Guest
 
Status:
Posts: n/a
Default re - 02-11-2013, 05: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.
   
Reply With Quote
Reply

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