-
Notifications
You must be signed in to change notification settings - Fork 18
/
main.lua
48 lines (38 loc) · 1.07 KB
/
main.lua
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
46
47
48
local splashes = {
["o-ten-one"] = {module="o-ten-one"},
["o-ten-one: lighten"] = {module="o-ten-one", {fill="lighten"}},
["o-ten-one: rain"] = {module="o-ten-one", {fill="rain"}},
["o-ten-one: black"] = {module="o-ten-one", {background={0, 0, 0}}},
}
local current, splash
local function next_splash()
current = next(splashes, current) or next(splashes)
splash = splashes[current]()
splash.onDone = next_splash
end
function love.load()
for name, entry in pairs(splashes) do
entry.module = require(entry.module)
splashes[name] = function ()
return entry.module(unpack(entry))
end
end
next_splash()
end
function love.update(dt)
splash:update(dt)
end
function love.draw()
splash:draw()
-- draw with both colors so its definetely visible
love.graphics.setColor(1, 1, 1)
love.graphics.print(current, 10, 10)
love.graphics.setColor(0, 0, 0)
love.graphics.print(current, 10, love.graphics.getHeight() - 20)
end
function love.keypressed(key)
if key == "escape" then
love.event.push("quit")
end
splash:skip()
end