-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.lua
83 lines (68 loc) · 1.73 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
flux = require('lib/flux')
class = require('lib/middleclass')
state = require('lib/stateswitcher')
moonshine = require('lib/moonshine')
require('modules/settings')
require('modules/assets')
require('modules/palette')
require('modules/transition')
require('modules/window')
require('modules/utils')
st = {}
function st.update(dt) end
function st.draw() end
function st.gamepadpressed(joystick, button) end
function st.gamepadreleased(joystick, button) end
function st.gamepadaxis(joystick, axis, value) end
function st.keypressed(k) end
function st.keyreleased(k) end
function love.load()
math.randomseed(os.time())
love.graphics.setDefaultFilter('nearest', 'nearest')
assets.init()
shader = moonshine(moonshine.effects.crt).chain(moonshine.effects.scanlines).chain(moonshine.effects.chromasep)
love.graphics.setFont(assets.fnt.font)
state.switch('menu')
end
function love.update(dt)
flux.update(dt)
st.update(dt)
transition.update(dt)
end
function love.draw()
shader(function()
-- st.draw()
-- transition.draw()
end)
st.draw()
transition.draw()
end
function love.gamepadpressed(joystick, button)
st.gamepadpressed(joystick, button)
end
function love.gamepadreleased(joystick, button)
if button == 'rightstick' then
settings.global.debug = not settings.global.debug
end
st.gamepadreleased(joystick, button)
end
function love.gamepadaxis(joystick, axis, value)
st.gamepadaxis(joystick, axis, value)
end
function love.keypressed(k)
if k == 'escape' then
love.event.push('quit')
end
st.keypressed(k)
window.keypressed(k)
end
function love.keyreleased(k)
st.keyreleased(k)
end
function love.focus(f)
settings.global.pause = not f
end
function love.quit()
window.save()
settings.save()
end