aboutsummaryrefslogtreecommitdiff
path: root/main.lua
blob: d9411c26813a3327460f563d4317c17ec06f1cad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
local Gamestate = require("libs.hump.gamestate")
local LoveSplash = require("libs.o-ten-one")
require("scenes.menu_scene");
require("scenes.level1_scene");

function love.load()
    -- initGame()
    bypassMenu()
end

function bypassMenu()
    Gamestate.switch(level1)
    Gamestate.registerEvents()
end

function initGame()
    splash = LoveSplash({background={0, 0, 0}})
    splash.onDone = onLoveSplashDone
end

function onLoveSplashDone()
    splash = nil
    Gamestate.switch(menu)
    Gamestate.registerEvents()
end

function love.draw()
    if splash then
        splash:draw()
    end
end

function love.update(dt)
    if splash then
        splash:update(dt)
    end
end

function love.keyreleased(key, scancode)
    -- Temporary
    if scancode == 'escape' then
        love.event.quit()    
    end
end