-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.lua
39 lines (34 loc) · 1.11 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
require('dependencies')
lovebird.port = 4444
function love.load()
-- set default scaling mode to nearest
love.graphics.setDefaultFilter('nearest', 'nearest')
gameFont = love.graphics.newFont('assets/fonts/pressStart2p.ttf', 8)
love.graphics.setFont(gameFont)
-- Set useful global variables
winWidth, winHeight, flags = love.window.getMode()
gameWidth = 288
gameHeight = 208
gameScale = 3
gameCanvas = love.graphics.newCanvas(gameWidth, gameHeight)
gravity = 500
gameWorld = GameWorld:Create()
gStateStack = StateStack:Create()
local level = LevelPlayState:Create('grasslands_test', 'bushly')
gStateStack:push(level)
frameNum = 0
end
function love.update(dt)
input:update(dt)
frameNum = frameNum + 1
gStateStack:update(dt)
-- comment out to enable web based debugger at http://localhost:4444
lovebird.update()
end
function love.draw()
love.graphics.setCanvas(gameCanvas)
love.graphics.clear(0, 0, 0, 0)
gStateStack:draw()
love.graphics.setCanvas()
love.graphics.draw(gameCanvas, 0, 0, 0, gameScale, gameScale)
end