function EventLoopCoroutine()
    dialogCoroutine = coroutine.create(function()
        loadMusic("res/music/07 - Animus.mp3")
        loadCharacter("res/characters/Naoya Enamoto/EN02BS.png", 0)
        loadCharacter("res/characters/Satoru Yukidoh/SA02AS.png", 1)
        loadBackground("res/backgrounds/himmel.png", 0)
        playMusic()
        local currentTime = getTime()
        while getTime() - currentTime < 1.5 do
            drawText("YUKIDOH's Plan: Beginning", 100, 100, 30)
            coroutine.yield()
        end
        dialogBox({
            "[Satoru] I should help my sister... But how am I supposed to do this in Leiblich?",
            "[Satoru] A plan... I need a plan... But alone, I can't do it."
        }, {})
        while isDialogExecuted() do
            coroutine.yield()
        end
        stopDrawBackground(0)
        local currentTime = getTime()
        while getTime() - currentTime < 1.5 do
            drawText("Enomoto's Appearance", 100, 100, 30)
            coroutine.yield()
        end
        drawBackground(getScreenWidth()/2, getScreenHeight()/2, 1.68, 0)
        drawCharacter(getScreenWidth()/2, getScreenHeight()/2, 2.2, 1)
        dialogBox({
            "[Enomoto] (Satoru... You're pretty tough, but also stupid if you think you can help your sister with Leiblich's support. How naive.)",
            "[Enomoto] Satoru, good morning.",
        }, {})
        while isDialogExecuted() do
            coroutine.yield()
        end
        stopDrawCharacter(0)
        drawCharacter(getScreenWidth()-getScreenWidth()/4, getScreenHeight()/2, 2.2, 1)
        drawCharacter(getScreenWidth()/4, getScreenHeight()/2, 2.2, 0)
        dialogBox({
            "[Satoru] Oh, good morning, Enomoto.",
            "[Enomoto] Leiblich is planning to create a device, and I think it could help you with your sister. Do you want to take part in its development?",
            "[Satoru] And... what is it? And why is Leiblich interested in such things?",
            "[Enomoto] It's a time-space travel machine. It allows one to open the \"Third Eye,\" which can move through time, not just space, as a 4D being.",
            "[Satoru] If this can help my sister, I'll join. Thanks, Enomoto.",
            "[Enomoto] It's nothing, really."
        }, {})
        while isDialogExecuted() do
            coroutine.yield()
        end
        stopMusic()
        stopDrawBackground(0)
        stopDrawCharacter(0)
        stopDrawCharacter(1)
        local currentTime = getTime()
        while getTime() - currentTime < 0.4 do
            coroutine.yield()
        end
        unloadMusic()
        unloadBackground(0)
        unloadCharacter(0)
        unloadCharacter(1)
        loadScript("scripts/SE03.lua")
    end)
end

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

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