1 decade ago by fugufish
am trying to build a crate (like in the biolab example), seem to hit a roadblock.
the crate must be able to be shot at by
- the player (TYPE A)
- AND also the enemies (TYPE B)
if I do this:
then my player can destroy the crates, but bullets from my enemies will just bounce off the crates.
how to make crates that react to player AND enemy fire? i've tried many combinations, all didn't work :(
the crate must be able to be shot at by
- the player (TYPE A)
- AND also the enemies (TYPE B)
if I do this:
EntityCrate=ig.Entity.extend({
type:ig.Entity.TYPE.B, // set as 'Enemy'
checkAgainst:ig.Entity.TYPE.NONE,
collides:ig.Entity.COLLIDES.ACTIVE, // must be active, so crates can stack up
EntityPlayerBullet=ig.Entity.extend({
type:ig.Entity.TYPE.A, //player is friendly
checkAgainst:ig.Entity.TYPE.NONE,
collides:ig.Entity.COLLIDES.PASSIVE,
EntityEnemyBullet=ig.Entity.extend({
type:ig.Entity.TYPE.NONE,
checkAgainst:ig.Entity.TYPE.A, // check against player
collides:ig.Entity.COLLIDES.PASSIVE,
then my player can destroy the crates, but bullets from my enemies will just bounce off the crates.
how to make crates that react to player AND enemy fire? i've tried many combinations, all didn't work :(
