-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.lua
53 lines (48 loc) · 1.26 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
local ScreenManager = require("lib.screen_manager")
local baton = require("lib.baton")
local push = require("lib.push")
require("src.globals")
require("lib.audio")
local inspect = require("lib.inspect")
Inspect = function(a, options)
print(inspect(a, options))
end
Class = require("lib.classic")
Signal = require("lib.signal")
Music = {}
function love.load()
-- INPUT
Input = baton.new {
controls = {
left = { "key:left", "key:a" },
right = { "key:right", "key:d" },
up = { "key:up", "key:w" },
down = { "key:down", "key:s" },
jump = { "key:space", "key:z" },
shoot = { "key:j", "key:x" },
cancel = { "key:escape" },
},
pairs = { move = { "left", "right", "up", "down" } },
}
-- WINDOW
love.graphics.setDefaultFilter("nearest", "nearest")
love.graphics.setLineStyle("rough")
push:setupScreen(
RES_X, RES_Y, WIN_X, WIN_Y, {
canvas = false,
fullscreen = false,
resizable = true,
vsync = true,
pixelperfect = true,
})
-- SCREENS
local screens = {
game = require("src.screens.Game"),
menu = require("src.screens.Menu"),
}
ScreenManager.init(screens, "menu")
ScreenManager.registerCallbacks()
end
function love.resize(w, h)
return push:resize(w, h)
end