-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.lua
47 lines (37 loc) · 1.04 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
local push = require('lib.push.push')
local Input = require('lib.input.input')
local Engine = require('src.Engine')
local colors = require('src.constants.colors')
local engine
function love.load()
local windowScale = 3
local virtualWidth, virtualHeight = love.window.getMode()
local windowWidth, windowHeight = virtualWidth * windowScale, virtualHeight * windowScale
love.window.setMode(windowWidth, windowHeight)
love.graphics.setDefaultFilter('nearest', 'nearest')
love.graphics.setLineStyle('rough')
love.graphics.setColor(colors.normal.default)
love.mouse.setVisible(false)
push.setupScreen(virtualWidth, virtualHeight, {
upscale = 'pixel-perfect',
canvas = true,
})
engine = Engine()
Input.bind_callbacks()
end
function love.update(dt)
engine:update(dt)
end
function love.draw()
push:start()
engine:draw()
push:finish()
end
function love.resize(width, height)
push.resize(width, height)
end
function love.textinput(t)
if engine.scene and engine.scene.textinput then
engine.scene:textinput(t)
end
end