-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.lua
62 lines (50 loc) · 1.11 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
require "conf"
require "audio"
require "Screens/menu"
require "Game/game"
require "Screens/gameover"
--require "PUC_Logo/PUC_Logo"
require "RPG_Full_Logo/RPG_Logo"
require "inputData"
--io.stdout:setvbuf("no")
local gameState = RPG_Logo--PUC_Logo
local goToState
function love.load()
menu.load()
audio.load()
game.load()
gameover.load()
RPG_Logo.load(1.2,1.5,1.2,love.returnToMenu)--PUC_Logo.load(1,1,1,1,love.returnToMenu)
audio.play(audio.stageMusic)
gameState.start()
inputData.start()
end
function love.keypressed(key)
gameState.keypressed(key)
end
function love.gamepadpressed(joy,but)
if gameState.gamepadpressed ~= nil then gameState.gamepadpressed(joy,but) end
end
function love.mousepressed(x,y,button)
gameState.mousepressed(x,y,button)
end
function love.update(dt)
gameState.update(dt)
end
function love.startGame(data)
goToState(game,data)
end
function love.returnToMenu()
goToState(menu,data)
end
function love.gameover()
goToState(gameover)
end
function goToState(s,data)
gameState = s
--gameState.start(data)
gameState.start(data)
end
function love.draw()
gameState.draw()
end