function onBegin()
    disableMovement()
    setFlag ("dark", true)
    walkTo(345, false, 1, true)
    say("SJ2021_LegS_cs2")
    setFlag ("dark", false)
    walkTo(467, false, 1, true)
end

function onEnd(room, wasSkipped)
    setFlag("dark", false)
    setFlag("usedoutrocutscene", true)
    if wasSkipped then
        local luanet = _G.luanet
        player.Facing = luanet.enum(luanet.import_type("Celeste.Facings"), "Right")
        local vector2 = require("#microsoft.xna.framework.vector2")
        player.Speed = vector2(0, 0)
        teleportTo(464, -448)
    end
    enableMovement()
end