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

function onBegin()

    disableMovement()
    makeUnskippable ()

    local level = getLevel()
    coroutine.yield(exCameraHelper.Level_ZoomToFocus(level, vector2(3368, 3060), 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.1
        setDarkness (darkness)
        if darkness < 0.1 then
            break
        end
    end

    wait(1)
    playMusic("event:/WHE/WHE_sunset2")
    say("WHE_NaCline_F_09")

    wait(1)

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

    teleportTo(2800, 3375, "sunset_07")

    endCutscene ()
	enableMovement()

end