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(2800, 3068), 2, 0.01))
    --coroutine.yield(level:ZoomSnap(vector2(160, 90), 2))

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

    wait(0.5)
    walkTo (2808, walkBackwards==false, speedMultiplier==1.0, keepWalkingIntoWalls==false)
    wait(0.5)
    say("WHE_NaCline_F_07")
    wait(0.5)
    player.DummyAutoAnimate = false
    player.Sprite:Play("lookUp")
    wait(1)
    player.DummyAutoAnimate = true
    wait(0.5)
    say("WHE_NaCline_F_08")
    wait(0.5)

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

    wait(1)
    teleportTo(3352, 3096, "sunset_06")

    enableMovement()
    endCutscene ()
	

end