function EventLoopCoroutine()
    dialogCoroutine = coroutine.create(function()
        loadBackground("res/backgrounds/Backgrounds (Other)/BG_C03N2.png", 0)
        loadCharacter("res/characters/Sayaka Yukidoh/SY07CL.png", 0)
        loadMusic("res/music/07 - Delusive consciousness amb..mp3")
        local currentTime = getTime()
        while getTime() - currentTime < 1.5 do
            drawText("Sayaka I", 100, 100, 30)
            coroutine.yield()
        end
        playMusic()
        drawBackground(getScreenWidth()/2, getScreenHeight()/2, 1.68, 0)
        drawCharacter(getScreenWidth()/2, getScreenHeight()/2, 2.1, 0)
        dialogBox({
            "[???] Sayaka! Hey! Are you sleeping?",
            "[Sayaka] Shadow... it's you again... please... stop it...",
            "[???] You need to run. No matter where, but you should.",
            "[Sayaka] Shadow... help me... I'm scared... scared of myself...",
            "[???] Don't worry. Everything will be okay!",
            "[???] Sayaka, who are you talking to?",
            "[Sayaka] Oh... no one, really...",
            "[???] I see. Let's continue."
        }, {}, -1)
        while isDialogExecuted() do 
            coroutine.yield()
        end
        stopDrawBackground(0)
        stopDrawCharacter(0)
        while getTime() - currentTime < 1.5 do
            drawText("SPHIA I", 100, 100, 30)
            coroutine.yield()
        end
        stopMusic()
        local currentTime = getTime()
        while getTime() - currentTime < 0.2 do
            coroutine.yield()
        end
        unloadMusic()
        loadMusic("res/music/01 - Anxiety.mp3")
        playMusic()
        dialogBox({
            "[???] This is SPHIA. But what am I doing here?",
            "[???] And why do I know about this place...",
            "[???] Right now, it doesn't matter. As I see, it's only just started being built...",
            "[???] Leiblich?... Why?...",
            "[???] This place..."
        }, {}, -1)
        while isDialogExecuted() do 
            coroutine.yield()
        end
        stopMusic()
        local currentTime = getTime()
        while getTime() - currentTime < 0.4 do
            coroutine.yield()
        end
        unloadBackground(0)
        unloadCharacter(0)
        unloadMusic()
        loadScript("scripts/SE04.lua")
    end)
end

function EventLoop()
    if dialogCoroutine and coroutine.status(dialogCoroutine) ~= "dead" then
        coroutine.resume(dialogCoroutine)
    end
end

setFont("res/InterTight-Regular.ttf")
EventLoopCoroutine()