runevision
05-06-2006 14:06:35
When making a game with quite a bit of different object, each with different actions to be performed upon collision, how is it handled most effectively?
MaterialPairs are clever for some things, but with many different objects that need unique actions (say, n objects) the amount of pairs needed will be n*(n-1)/2 which can be really a lot.
I'd like to have just a few types of materials (and thus, just a few types of material pairs), and then be able to call some additional specific actions on certain combinations of objects regardless of their materials. Like eg. "this object have the environment material and acts like the environment when any object collide with it, but besides that, it triggers this specific action when the player collides with it". How would I do something like that?
Thanks in advance,
Rune
MaterialPairs are clever for some things, but with many different objects that need unique actions (say, n objects) the amount of pairs needed will be n*(n-1)/2 which can be really a lot.
I'd like to have just a few types of materials (and thus, just a few types of material pairs), and then be able to call some additional specific actions on certain combinations of objects regardless of their materials. Like eg. "this object have the environment material and acts like the environment when any object collide with it, but besides that, it triggers this specific action when the player collides with it". How would I do something like that?
Thanks in advance,
Rune