function onBegin()
    setFlag("noControls", true)
    disableRetry()

    setFlag("heat", true)

    player.ForceCameraUpdate = true
    local level = getLevel()

    walk(100)
    setFlag("black", true)
    run(400)
    
    setFlag("black", false)
    run(210)
    jump()
    run(60)
    jump()
    walk(50)

    -- Enter red bubble

    wait(1)
    run(50)
    jump()
    setFlag("black", true)
    run(300)
    setFlag("black", false)
    run(250)
    jump()
    walk(40)

    -- Enter red bubble

    wait(1)

    walk(-15)
    jump()
    run(30)

    waitUntilOnGround()
    walk(8)
    jump()
    run(108)
    jump()
    run(80)
    jump()
    setCameraOffset(2, 1)
    run(80)
    jump()
    walk(40)
    player.ForceCameraUpdate = false

    -- Enter red bubble

    wait(0.3)
    setFlag("noControls", false)
    wait(1.0)

end

function onEnd(room, wasSkipped)
    enableMovement()
    enableRetry()
end

function dashRight()
    celeste.SaveData.Instance.Assists.DashAssist = false
    celeste.Input.Rumble(celeste.RumbleStrength.Strong, celeste.RumbleLength.Medium)
    monocle.MInput.Disabled = true
    player.OverrideDashDirection = vector2(1, 0)
    player.StateMachine.Locked = false
    player.StateMachine.State = player:StartDash()
    player.Dashes = 0
    wait(0.1)
    while (player.Speed.X > 0) do -- Waits till maddy stops moving up
      player.Dashes = 0
      celeste.Input.MoveY.Value = 1
      celeste.Input.MoveX.Value = 0
      wait()
    end
    player.OverrideDashDirection = nil
    player.StateMachine.State = 11
    player.StateMachine.Locked = true
    monocle.MInput.Disabled = false
    player.DummyGravity = false
    player.DummyAutoAnimate = false -- Remove this if you want Madeline to wobble while in midair, this will stop her from animating
end