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

function onBegin()
  player.Facing = getEnum("Celeste.Facings", "Right")
  disableRetry()
  disableMovement()
  player.ForceCameraUpdate = false
  wait(1)
  say("ending_appels_1")
  wait(1.5)
  coroutine.yield(celeste.CutsceneEntity.CameraTo(vector2(53320, 10044), 3))
  wait(1.5)
  getLevel():add(coroutineEntity)
  coroutineEntity:add(monocle.Coroutine(celeste.CutsceneEntity.CameraTo(vector2(53320, 10044), 1000)))
  coroutineEntity:add(monocle.Coroutine(say("ending_appels_2"))
end

function onEnd()
  player.ForceCameraUpdate = true
  enableRetry()
  enableMovement()
end