Oct 1, 2008 at 7:43 PM
Edited Oct 1, 2008 at 7:48 PM
I was afraid you were going to say that.
Since there are so many possible sensors, I've got to create a list of them to pass in the class or something.
I was hoping there'd be an easier way of creating the sensors to somehow prevent the problem.
The code is fairly confusing, so I apologize ahead of time.
This is where I make a "block" into a sensor.
//temp variables so that the block can stay in its position after the physics reset
float lastRotation = blockBody.Rotation;
Vector2 lastPosition = blockBody.Position;
//reset physics to keep the block from using an old force
blockBody.Rotation = lastRotation;
blockBody.Position = lastPosition;
false; //an attachment to the block there
And this is where I test to see if it collided with anything on stage.
if (ps.ArbiterList.Count == 0)
arbiter in ps.ArbiterList)
if (arbiter.GeomA == inputBlock.getBlockGeom() || arbiter.GeomB == inputBlock.getBlockGeom())
play(); //play animation
isClear = false;