local function doFadeWipe(state)
  fadeWipe = celeste.FadeWipe(engine.Scene, state, nil)
  engine.Scene:Add(fadeWipe)
  fadeWipe.duration = 2
  fadeWipe.EndTimer = 1
end


function onBegin()

  if getFlag("abririgreja") then

  disablePause()
  disableMovement()
  player.ForceCameraUpdate = true
  waitUntilOnGround()
  walkTo(8273)
  wait(0.5)

  playSound("event:/game/wanderBDay2/omori_door_enter")
  wait(0.5)
  setFlag("portaigreja")
  wait(1)
  playSound("event:/game/wanderBDay2/omori_door_rangido")
  wait(2)

  walkTo(8358)

  setFlag("portaigreja", false)
  wait(2.5)
  playSound("event:/game/wanderBDay2/omori_door_exit")
  wait(1)

  doFadeWipe(false)
  wait(1.3)
  setFlag("abririgreja", false)
  setFlag("enterigreja")

  end

end