WP7 - Remove Object on Tap

Sep 26, 2011 at 8:12 PM

I have a stack of boxes (Rect in Canvas in UserControl) that I create programatically.  The boxes fall to the ground due to gravity.  How do I remove a box when I tap it and have all the boxes above it fall?

Coordinator
Oct 4, 2011 at 5:50 PM

There is a DeletePhysicsObject method on the PhyicsController -

_physicsController.DeletePhysicsObject(spriteName);

 

Apr 12, 2012 at 1:00 PM

Plus:

Sometimes (depending on your Settings), you need to notify all "other" Boxes, to wake up.

Other Boxes don't know that a Box has been removed, and while they are in SleepMode, the just do nothing.

So wake them up or set SleepingAllowed to false on to all Boxes (might not be a good idea for every case).