Some questions.

Started by Disastorm, February 07, 2010, 05:17:30 AM

Previous topic - Next topic

Disastorm

Quote from: paulscode on February 08, 2010, 03:12:18 PM
In the game I'm currently working on, for collision between enemy ships for example, what I did was to iterate through the list of ships setting check_others and check_self to test them one at a time.  The time required is similar to sorting a list I think, so I don't know how well this would work for a huge list of objects.  It works well in my case, anyway.  I'd be interested to see if there is another way to do this, too.
hey I just noticed in the api doc it says:

Sets if and how the object will respond to collisions. Setting mode to COLLISION_CHECK_NONE (which is default) means, that the object can't be partner in a collision with other objects. Setting it to COLLISION_CHECK_OTHERS means that other objects may collide with this object and setting it to COLLISION_CHECK_SELF means, that the object itself may collide with other objects. The modes may be combined by using the or-operator | .

It looks like you can combine them by using the or-operator.  I didn't know that.