-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.lua
45 lines (35 loc) · 893 Bytes
/
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
require 'game.lua'
require 'menu.lua'
local g = love.graphics
local m = love.mouse
state = menu
sound = true
function love.load()
love.filesystem.setIdentity("davegoneapeshit")
if love.filesystem.exists('highscore.lua') then
love.filesystem.load('highscore.lua')()
else
bestTime = 20.52
end
if sound then
musicSource = musicSource or love.audio.newSource("assets/audio/music.mp3")
musicSource:setLooping("true")
musicSource:setVolume(1)
musicSource:play()
end
if state.load then state.load() end
m.setVisible(false)
end
function love.keypressed(key)
if state.keypressed then state.keypressed(key) end
end
function love.keyreleased(key)
if state.keyreleased then state.keyreleased(key) end
end
function love.update(dt)
if state.update then state.update(dt) end
end
function love.draw()
g.setColor(255, 255, 255, 255)
if state.draw then state.draw() end
end