Hi,
i've got a problem and i hope someone may help:
i'm building a simple-game-thingy. 'things' get tossed out of windows on the left of the stage and you have to get them in contact with sensors on the right. you are a little guy standing on the floor with a stick in your hand and have to prevent the things getting into contact with the 'floor-sensor'. things will bounce of your fancy stick. but enough 'bout that.
here's the problem.
if a thing makes contact with the floor sensor the 2nd time i want it to not collide with the stick anymore.
well, i'm resetting the mask bits of the bodys shapes to fit this behaviour and this works nicely, except for one insanely terrible side-effect: this will also affect all other bodys i create from that shape... no, wait! i'm creating a new shape-def for everyone of them. wtf? sorry. it may be that i got something wrong here. sorry, for perhabs wasting your time.
but you could look at my binary in the meantime. some time has passed since my last binary adventures. is that right? are those the correct box2d '16 collision categories'?
thx, :*
i've got a problem and i hope someone may help:
i'm building a simple-game-thingy. 'things' get tossed out of windows on the left of the stage and you have to get them in contact with sensors on the right. you are a little guy standing on the floor with a stick in your hand and have to prevent the things getting into contact with the 'floor-sensor'. things will bounce of your fancy stick. but enough 'bout that.
here's the problem.
if a thing makes contact with the floor sensor the 2nd time i want it to not collide with the stick anymore.
well, i'm resetting the mask bits of the bodys shapes to fit this behaviour and this works nicely, except for one insanely terrible side-effect: this will also affect all other bodys i create from that shape... no, wait! i'm creating a new shape-def for everyone of them. wtf? sorry. it may be that i got something wrong here. sorry, for perhabs wasting your time.
but you could look at my binary in the meantime. some time has passed since my last binary adventures. is that right? are those the correct box2d '16 collision categories'?
Code:
/////////////////////////
/// BITMASKS
///
/// 0x0000 = 0 = 00000000.00000000 // collides with nothing
/// 0x0001 = 1 = 00000000.00000001 //
/// 0x0002 = 2 = 00000000.00000010 // floors
/// 0x0004 = 4 = 00000000.00000100 // walls
/// 0x0008 = 8 = 00000000.00001000 // playerchar
/// 0x0010 = 16 = 00000000.00010000 // playerstaff
/// 0x0020 = 32 = 00000000.00100000 // coins
/// 0x0040 = 64 = 00000000.01000000 //
/// 0x0080 = 128 = 00000000.10000000 // sensors
/// 0x0100 = 256 = 00000001.00000000 //
/// 0x0200 = 512 = 00000010.00000000 //
/// 0x0400 = 1024 = 00000100.00000000 //
/// 0x0800 = 2048 = 00001000.00000000 //
/// 0x1000 = 4096 = 00010000.00000000 //
/// 0x2000 = 8192 = 00100000.00000000 //
/// 0x4000 = 16384 = 01000000.00000000 //
/// 0x8000 = 32768 = 10000000.00000000 //
/// BITMASKS
///
/// 0x0000 = 0 = 00000000.00000000 // collides with nothing
/// 0x0001 = 1 = 00000000.00000001 //
/// 0x0002 = 2 = 00000000.00000010 // floors
/// 0x0004 = 4 = 00000000.00000100 // walls
/// 0x0008 = 8 = 00000000.00001000 // playerchar
/// 0x0010 = 16 = 00000000.00010000 // playerstaff
/// 0x0020 = 32 = 00000000.00100000 // coins
/// 0x0040 = 64 = 00000000.01000000 //
/// 0x0080 = 128 = 00000000.10000000 // sensors
/// 0x0100 = 256 = 00000001.00000000 //
/// 0x0200 = 512 = 00000010.00000000 //
/// 0x0400 = 1024 = 00000100.00000000 //
/// 0x0800 = 2048 = 00001000.00000000 //
/// 0x1000 = 4096 = 00010000.00000000 //
/// 0x2000 = 8192 = 00100000.00000000 //
/// 0x4000 = 16384 = 01000000.00000000 //
/// 0x8000 = 32768 = 10000000.00000000 //
thx, :*