local vector2 = require("#microsoft.xna.framework.vector2")

function onBegin()
    position = vector2(96, 200)
    position_x = 0
    disableMovement()
    makeUnskippable()
    disableRetry()
    player.ForceCameraUpdate = true
    player.DummyAutoAnimate = false
    steps = 0
    while (true) do
        wait()
        position.X = position.X + 2
        player.Position = position
        steps = steps + 1
        if steps == 500 then
            playMusic("event:/AnEnormousSmileyFace/no-rest-zero")
        end
        if steps > 600 then
            break
        end
    end
    setFlag("car_1", true)
    setFlag("car_deccel_x", true)
    setFlag("car_call", true)
    while (true) do
        wait()
        position.X = position.X + 1
        player.Position = position
        steps = steps + 1
        if steps > 670 then
            break
        end
    end
    setFlag("car_1", true)
    setFlag("car_deccel_x", true)
    setFlag("car_call", true)
    wait()
    steps = steps + 1
    setFlag("car_0", true)
    setFlag("car_play", true)
    setFlag("car_call", true)
    while (true) do
        wait()
        player.Position = position
        steps = steps + 1
        if steps > 780 then
            break
        end
    end
    position.X = 1285
    position.Y = 160
    player.Position = position
    player.DummyAutoAnimate = true
    wait(0.5)
    walkTo(1324)
    jump(0.5)
    walkTo(1350)
    waitUntilOnGround()
    wait(1)
    player.DummyAutoAnimate = false
    player.Sprite:Play("lookUp")
    wait(2)
    player.DummyAutoAnimate = true
    wait(0.6)
    walkTo(1408)
    zoom = 3
    coroutine.yield(engine.Scene:ZoomTo(vector2(309 - 149 / zoom, 67), zoom, 6))
    wait(1)
    setFlag("darkness_fade", true)
    wait(1)
    engine.Scene:ResetZoom()
    enableMovement()
end