aboutsummaryrefslogtreecommitdiff
path: root/main.lua
blob: 5b61f70de9da9d7d2260e99593c534069859aedf (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
45
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()
    love.graphics.setDefaultFilter("nearest", "nearest")
    --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