-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.lua
47 lines (37 loc) · 951 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
require "src.import"
import "switch"
import "table"
---@type Modules
local M = import "modules"
local beige = { .75, .7, .6 }
local arrow = love.mouse.getSystemCursor("arrow")
local hand = love.mouse.getSystemCursor("hand")
function love.load()
M.hud.init()
end
function love.update()
M.connection.update()
end
function love.keypressed(key)
return M.hud.on_key_pressed(key)
end
function love.textinput(char)
M.hud.on_text_input(char)
end
function love.mousepressed(x, y, button)
if M.hud.on_mouse_pressed(x, y, button) then return end
M.game.on_mouse_pressed(x, y, button)
end
function love.mousemoved(x, y)
local hover = false
if M.hud.on_mouse_moved(x, y) or M.game.on_mouse_moved(x, y) then hover = true end
love.mouse.setCursor(hover and hand or arrow)
end
function love.draw()
love.graphics.clear(beige)
M.game.draw()
M.hud.draw()
end
function love.quit()
M.connection.end_game()
end