local monocle = require("#monocle")
local coroutineEntity = monocle.Entity()
local celeste = require("#celeste")


function onBegin()
		local level = getLevel()
                level:add(coroutineEntity)


	disableMovement()
        disableRetry()
        getLevel():add(coroutineEntity)
	coroutine.yield(getLevel():ZoomTo(vector2(160, 115), 1.7, 0))
        wait(2)
        playSound("event:/new_content/game/10_farewell/ppt_mouseclick")
	setFlag("noir", false)
        wait(1)
        coroutine.yield(getLevel():ZoomBack(0.5))
	helpers.say("RESORTSHOW")
        playMusic("event:/Shinxray/TVTIME")
        setFlag("musiquefade", true)
        wait(1)
	helpers.say("RESORTSHOWB")
        teleportTo (0,0,"Checkpoint1")
  enableMovement()
	
end

function onEnd(room, wasSkipped)
    if wasSkipped then
 playMusic("event:/Shinxray/TVTIME")
        setFlag("musiquefade", true)
	   teleportTo (0,0,"Checkpoint1")
setFlag("noir", false)
 	 enableMovement()
   end
end
