-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.lua
64 lines (44 loc) · 1.15 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
58
59
60
61
62
63
-- Import global libs
Object = require("lib/classic")
Inspect = require("lib/inspect")
Util = require("lib/util")
Bump = require("lib/bump")
Sti = require("lib/sti")
Camera = require("lib/hump/camera")
CS = require("lib/cscreen")
-- import local libs
-- Import local classes
local StateGame = require("state_game")
-- Define constants
TILE_SIZE_O = 16 -- Original tile size
TILE_SIZE = 64 -- Size we want to be rendered
-- Define global variables
input = nil
-- Define local variables
local game
function love.load()
CS.init(800, 600, true)
CS.setColor(0, 255, 0)
love.graphics.setDefaultFilter("nearest", "nearest", 1)
love.graphics.setBackgroundColor(255, 0, 255)
-- love.graphics.setBlendMode("alpha")
game = StateGame("res/lev/level_1")
input = require("conf_input")
end
function love.update(dt)
io.flush()
if input:released("quit_game") then
love.event.quit()
end
-- print("FPS:", love.timer.getFPS())
game:update(dt)
end
function love.draw()
CS.apply()
game:draw()
CS.cease()
end
function love.resize(width, height)
CS.update(width, height)
game:resize(width, height)
end