-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenu.lua
More file actions
67 lines (59 loc) · 1.29 KB
/
Copy pathMenu.lua
File metadata and controls
67 lines (59 loc) · 1.29 KB
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
require "Home"
function love.load()
gamestate = "Home"
if (gamestate == 'Home') then
home_load()
else if (gamestate == 'Game') then
game_load()
else if (gamestate == 'Game Over') then
gameover_load()
end
end
end
end
function love.draw()
if (gamestate == 'Home') then
menu_draw()
else if (gamestate == 'Game') then
game_draw()
else if (gamestate == 'Game Over') then
gameover_draw()
end
end
end
end
function love.update(dt)
if (gamestate == 'Home') then
home_update(dt)
else if (gamestate == 'Game') then
game_update(dt)
else if (gamestate == 'Game Over') then
gameover_update(dt)
end
end
end
end
function home_load()
menu_load()
titlefont=love.graphics.newFont("Xcelsion.ttf",40)
love.graphics.setFont(titlefont)
buttonfont=love.graphics.newFont("Xcelsion.ttf",30)
end
function home_draw()
if gamestate=="Home" then
menu_draw()
end
end
function home_update(dt)
if gamestate=="Home" then
menu_update(dt)
end
end
function love.keypressed( key, scancode, isrepeat )
if gamestate =="Home" then
menu_keyboard(key)
else if gamestate == "Game Over" then
gameover_keyboard(key)
end
end
end