local vector2 = require("#microsoft.xna.framework.vector2")
local exCameraHelper = require("#Celeste.Mod.ExCameraDynamics.Code.Module.ExCameraInterop")

function onBegin()

    disableMovement()
    makeUnskippable ()

    wait(1)
    local level = getLevel()
    coroutine.yield(exCameraHelper.Level_ZoomToFocus(level, vector2(3368, 3348), 2, 0.01))
    --coroutine.yield(level:ZoomSnap(vector2(160, 90), 2))

    player.Facing = getEnum("Celeste.Facings", "Right")

    local darkness = getDarkness ()
    while (true) do
        wait(0.01)
        darkness = darkness - 0.05
        setDarkness (darkness)
        if darkness < 0 then
            break
        end
    end

    wait(1.5)
    say("WHE_NaCline_F_10")
    wait(0.5)
    playSound("event:/WHE/WHE_keyboard2")
    wait(1.5)
    say("WHE_NaCline_F_11")

    wait(1.5)

    local darkness = getDarkness ()
    while (true) do
        wait(0.01)
        darkness = darkness + 0.01
        setDarkness (darkness)
        if darkness > 0.99 then
            break
        end
    end

    wait(2)

    teleportTo(664, 3792, "end_01")

    endCutscene ()
	enableMovement()

end