i want that if the actor hits an object that just the actor freezes for 1 second but i dont know how to do this
Please help me :D
// with instance field
private int freezeTimeRemaining;
// at beginning of act method
if (freezeTimeRemaining != 0 && --freezeTimeRemaining != 0) return;
// elsewhere in act method (or a method called by it)
if (isTouching(Icing.class)) // adjust class name as needed
{
freezeTimeRemaining = 55;
}