-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.lua
More file actions
51 lines (41 loc) · 998 Bytes
/
Copy pathmain.lua
File metadata and controls
51 lines (41 loc) · 998 Bytes
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
love.graphics.setDefaultFilter("nearest", "nearest")
require "screen"
require "player"
require "color"
require "camera"
require "pause"
require "State"
require "Level"
require "Billboard"
function loadlevel()
State.setcurrent(require "level.0"())
end
function love.load(arg)
love.audio.setDistanceModel("linearclamped")
screen.load()
State.setcurrent(require "introcredit")
end
function love.update(dt)
if not pause.paused then
State.current:update(dt)
end
end
function screen.draw()
State.current:draw()
end
function love.keypressed(key)
if key == "f5" then
loadlevel()
else
return screen.keypressed(key) or pause.keypressed(key) or State.current:keypressed(key)
end
end
function love.keyreleased(key)
return State.current:keyreleased(key)
end
function love.mousepressed(x, y, button)
return pause.mousepressed(x, y, button) or State.current:mousepressed(x, y, button)
end
function love.mousereleased(x, y, button)
return State.current:mousereleased(x, y, button)
end