function onBegin()
    player.ForceCameraUpdate = true
    disableMovement()
	disableRetry()
    setFlag ("spawnbaddie",true)
    walk (5,false,0.8)
    wait (0.2)
    say ("moonruins_ending1")
    say ("moonruins_ending2")
    wait (0.2)
    walk (100,false,0.8)
    wait (0.2)
    player.DummyAutoAnimate = false
    player.Sprite:Play("sleep", false, false)
    say ("moonruins_ending3")
    player.DummyAutoAnimate = true
    completeArea ()
end


function onEnd(room, wasSkipped)
    if wasSkipped then
         completeArea ()
    end
end