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(632, 4324), 2, 0.001))
    cameraZoomHooks.ForceCameraTo(level, cameraFocus.FromCenter(vector2(632, 4324), 2))

    

    wait(2)
    player.Facing = getEnum("Celeste.Facings", "Right")
    setFlag("feel1", true)

    local darkness = getDarkness ()
    while (true) do
        wait(0.01)
        darkness = darkness - 0.02
        setDarkness (darkness)
        if darkness < 0.02 then
            break
        end
    end
    
    wait(1)
    playSound("event:/WHE/WHE_keyboard0")
    wait(4)
    miniTextbox("WHE_NaCline_H_10")
    wait(2)
    playSound("event:/WHE/WHE_keyboard0")
    wait(4)

    playMusic("event:/WHE/WHE_epiphany")
    wait(4)

    local level = getLevel()
    cameraZoomHooks.ForceCameraTo(level, cameraFocus.FromCenter(vector2(1096, 4324), 1))
    teleportTo(1044, 4384, "feel_02")

    enableMovement()
    endCutscene ()
	

end