I've played around with box2d the last couple of days and I really like this engine.
I have a minor issue revolving around impacting different objects of the same instance differently.
Right now, I have an attack which hits an area around the player.
Imagine I have a scene like this:
O__P__O
The O's being boxes, and P being the player. When he attacks, he hits both of these objects. Now consider this code snippet:
-Attack Detection is overlapping Box
-Attacking of Player is 1
-X Position of Player <= X("Box")
+Apply impulse, force 70, angle 45 + Random(15) degrees
-Attack Detection is overlapping Box
-Attacking of Player is 1
-X Position of Player > X("Box")
+Apply impulse, force 70, angle 135 - Random(15) degrees
When the attack is performed, they both fly to the right, which shows the first code snippet is being fired for the both of them. I obviously want the left box to fly in the other direction (and it does work, if I only hit that box from the right side, without hitting the box to the right).
I was looking into using the ForEach object, but that didn't work out for me.
Can anyone help me? Thank you.