-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.lua
43 lines (32 loc) · 933 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
-- Setup global variables
SceneManager = require "SceneManager"
-- Setup local
local MainScene
function love.load()
font = love.graphics.newFont("wqy-microhei-lite.ttc", 16)
font:setFilter("linear", "linear")
love.graphics.setFont(font)
MainScene = require("MainScene")(SceneManager)
SceneManager.load(MainScene)
end
function love.mousepressed(x, y, button, isTouch)
SceneManager.mousepressed(x, y, button, isTouch)
end
function love.mousereleased(x, y, button, isTouch)
SceneManager.mousereleased(x, y, button, isTouch)
end
function love.keypressed(key, scancode, isrepeat)
SceneManager.keypressed(key, scancode, isrepeat)
end
function love.keyreleased(key)
SceneManager.keyreleased(key)
end
function love.update(dt)
SceneManager.update(dt)
end
function love.draw()
love.graphics.clear()
SceneManager.draw()
love.graphics.setColor(255, 255, 255)
love.graphics.print("FPS " .. love.timer.getFPS(), 3, 3)
end