-
Notifications
You must be signed in to change notification settings - Fork 12
/
main.lua
57 lines (40 loc) · 1.23 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
io.stdout:setvbuf("no")
require "loxel"
local funkin = require "funkin"
function love.load() funkin.load() end
function love.resize(w, h) game.resize(w, h) end
function love.keypressed(key, ...)
if key == "f5" then
game.resetState(true)
elseif Project.DEBUG_MODE and love.keyboard.isDown("lctrl", "rctrl") then
if key == "f4" then error("force crash") end
if key == "`" then return "restart" end
end
controls:onKeyPress(key, ...)
game.keypressed(key, ...)
end
function love.keyreleased(...)
controls:onKeyRelease(...)
game.keyreleased(...)
end
function love.wheelmoved(...) game.wheelmoved(...) end
function love.mousemoved(...) game.mousemoved(...) end
function love.mousepressed(...) game.mousepressed(...) end
function love.mousereleased(...) game.mousereleased(...) end
function love.touchpressed(...) game.touchpressed(...) end
function love.touchreleased(...) game.touchreleased(...) end
function love.update(dt)
funkin.update(dt)
game.update(dt)
end
function love.draw() game.draw() end
function love.focus(f) game.focus(f) end
function love.fullscreen(f, t)
funkin.fullscreen(f)
game.fullscreen(f)
end
function love.quit()
funkin.quit()
game.quit()
end
function love.errorhandler(msg) return funkin.throwError(msg) end