local vector2 = require("#microsoft.xna.framework.vector2")
local exCameraHelper = require("#Celeste.Mod.ExCameraDynamics.Code.Module.ExCameraInterop")
local cameraFocus = require("#Celeste.Mod.ExCameraDynamics.Code.Entities.CameraFocus")
local cameraZoomHooks = require("#Celeste.Mod.ExCameraDynamics.Code.Hooks.CameraZoomHooks")

function onBegin()

    disableMovement()
    disablePause ()

    --local level = getLevel()
    --coroutine.yield(exCameraHelper.Level_ZoomToFocus(level, vector2(2360, 4328), 1, 0.001))
    setDarkness(0.3)
    setBloomStrength(0.5)

    player.DummyAutoAnimate = false
    player.Sprite:Play("lookUp")
    wait(1.5)

    setFlag("LuckyHelper_DisableCameraUpdateOnTeleportFlag",false)
    setFlag("LuckyHelper_DisablePlayerCameraUpdate",false)

    player.ForceCameraUpdate = true
    local cameray = 0
    while (true) do
        wait(0.05)
        cameray = cameray - 0.1
        setCameraOffset (0, cameray)

        if cameray < -4.5 then
            break
        end

    end

    wait(5)

    setFlag("LuckyHelper_DisableCameraUpdateOnTeleportFlag",true)
    setFlag("LuckyHelper_DisablePlayerCameraUpdate",true)

    setCameraOffset (0, -6)
    local level = getLevel()
    cameraZoomHooks.ForceCameraTo(level, cameraFocus.FromCenter(vector2(2792, 4224), 1))
    teleportTo(2792, 4400, "feel_06")


    enableMovement()
    enablePause ()
    endCutscene ()
	

end