-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.lua
52 lines (48 loc) · 957 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
46
47
48
49
50
51
52
game = require("game")
menu = require("menu")
settings = require("settings")
json = require("json")
function love.load()
scene = 0
mobile = true
--scene 0: menu, scene 1: game, scene 2: settings
menu.load(mobile)
end
--touching/mouse clicking support
function love.touchpressed(id, x, y, dx, dy, p)
if scene == 0 then
menu.clicked(x, y)
elseif scene == 1 then
game.clicked(x, y)
elseif scene == 2 then
settings.clicked(x, y)
end
end
function love.mousepressed(x, y, b, isTouch)
if scene == 0 then
menu.clicked(x, y)
elseif scene == 1 then
game.clicked(x, y)
elseif scene == 2 then
print("settingclicked")
settings.clicked(x, y)
end
end
function love.draw()
if scene == 0 then
menu.draw()
elseif scene == 1 then
game.draw()
elseif scene == 2 then
settings.draw()
end
end
function loadScene(i)
scene = i
print(scene)
if scene == 1 then
game.load(mobile)
elseif scene == 2 then
settings.load(mobile)
end
end