-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.lua
89 lines (79 loc) · 2.12 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
require "src/Button"
require "src/Initiation"
require "src/Plateform"
require "src/SceneSwap"
require "src/MovePlayer"
require "src/PlayerCustomization"
require "src/GameActions"
require "src/Bat"
require "src/Particules"
require "src/Sound"
require "src/Cursor"
require "src/Timer"
require "src/Feather"
require "src/StarEnd"
require "src/Item"
function love.load()
love.window.setMode(1920, 1080)
love.window.setTitle("Jam Super Héros")
Sound.load()
Cursor.load()
SceneSwap.LoadSceneSwap()
GameActions.load()
PlayerCustomization.load()
MovePlayer.Load()
Button.load()
Bat.load()
path = "maps/map_simple"
plateforms = Plateform.load(path)
SceneSwap.LoadSceneSwap(plateforms)
Item.Load()
end
function love.update(dt)
SceneSwap.UpdateSceneSwap(dt)
MovePlayer.Update(dt)
Bat.Update(dt)
Particle.Update(dt)
Timer.Update(dt)
Item.Update(dt)
end
function love.draw()
GameActions.drawBackground()
Button.draw()
if ActualGameState == GameState["Game"] then
love.mouse.setVisible(false)
Plateform.draw(plateforms)
SceneSwap.DisplaySceneSwap()
Particle.draw()
Timer.draw()
Item.Draw()
else
Bat.draw()
GameActions.drawTitle()
love.mouse.setVisible(true)
GameActions.drawTitle()
if ActualGameState == GameState["Menu"] or ActualGameState == GameState["End"] then
Credit.draw()
end
if ActualGameState == GameState["PlayerCustomization"] then
PlayerCustomization.draw()
end
if (ActualGameState == GameState["End"]) then
love.graphics.print("THANKS FOR PLAYING", 420, 500, 0, 2, 2)
end
end
end
function love.mousepressed(x, y, btn, istouch)
Button.mousepressed(x, y, btn, istouch)
MovePlayer.SetDirection(x, y, btn)
end
function love.mousereleased(x, y, button)
Button.mousereleased(x, y, button)
end
function love.keypressed(key)
Button.keypressed(key)
end
function love.mousemoved(x, y, dx, dy, istouch)
Button.MouseMoved(x, y, dx, dy, istouch)
Item.MouseMoved(x, y, dx, dy, istouch)
end