/** You lose if a fragile object is knocked over! In the Doll's House scene(s) Fragile objects */ class Fragile : Scenery { var isKnockedOver = false override fun tick() { super.tick() if (!isKnockedOver && DollsHouseDirector.instance is Play) { if (actor.direction.degrees < -45 || actor.direction.degrees > 45) { isKnockedOver = true Star.createRing(actor, "starRed") Play.instance.knockedFragile() replaceAction( Fade(actor.color, 1, 0, Eases.easeIn) then Kill(actor) ) } } } }