local function fromRoom(x,y)
    return engine.Scene.LevelOffset + vector2(x, y)
end

local coroutineEntity = monocle.Entity()


local vector2 = require("#microsoft.xna.framework.vector2")

function onBegin(room)
  disableMovement()
  player.ForceCameraUpdate = false
	setFlag("intro", true) 
  wait(0.3)	
  coroutine.yield(celeste.CutsceneEntity.CameraTo(vector2(player.Position.X + 588, player.Position.Y - 145), 0.1, monocle.Ease.SineInOut))
  wait(0.1)
  wait(1)
  coroutine.yield(celeste.CutsceneEntity.CameraTo(vector2(player.Position.X + 378, player.Position.Y - 145), 8, monocle.Ease.SineInOut))
  wait(1.5)
    walk(50, false, 0.5)
  enableMovement()
end

function onEnd(room, wasSkipped)
  enableMovement()
  player.DummyAutoAnimate = true
  player.ForceCameraUpdate = true
  getLevel():ResetZoom()
  enableMovement()
    if wasSkipped then
    player.DummyAutoAnimate = true
    player.ForceCameraUpdate = true
    getLevel():ResetZoom()
    enableMovement()
    end
end