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(2224, 3068), 1.7, 0.01))
    --coroutine.yield(level:ZoomSnap(vector2(160, 90), 2))
    
    player.Sprite.Visible = false
    player.Hair.Visible = false

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

    say("WHE_NaCline_F_05")

    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)
    say("WHE_NaCline_F_06")

    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
    
    player.Sprite.Visible = true
    player.Hair.Visible = true
    player.DummyAutoAnimate = true
    teleportTo(2784, 3103, "sunset_05")

    endCutscene ()
	enableMovement()

end