local function doFadeWipe(state)
  fadeWipe = celeste.FadeWipe(engine.Scene, state, nil) -- (state = "false" escurece ,"true" clareia)
  engine.Scene:Add(fadeWipe)
  fadeWipe.duration = 2
  fadeWipe.EndTimer = 1
end


function onBegin()

  if getFlag("outcorredor") then

    disablePause()
    disableMovement()
    doFadeWipe(true)
    player.ForceCameraUpdate = true
    wait(1)

    setFlag("corredor", false)
    setFlag("outcorredor", false)
    setFlag("backroutdoor1_2", true)
    enableMovement()
    enablePause()

    wait(2)
    playSound("event:/game/wanderBDay2/omori_Knock_WoodDoor", player.Position)

  end

end