-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
42 lines (32 loc) · 1.12 KB
/
main.lua
File metadata and controls
42 lines (32 loc) · 1.12 KB
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
require("engine.sff")
require("engine.base.gamepad")
require("states.splash_screen.main")
gamera = require("engine.base.gamera.gamera")
require("states.game.main")
function love.load()
love.graphics.setDefaultFilter("nearest", "nearest") -- avoid blurry pixel art
sff = sff()
local worldWidth = 2000
local worldHeight = 2000
camera = gamera.new(0, 0, worldWidth, worldHeight)
camera:setScale(CONF.cameraZoom)
camera:setPosition(-1*(CONF.windowWidth/CONF.cameraZoom),-1*(CONF.windowHeight/CONF.cameraZoom))
cameraHud = gamera.new(0, 0, worldWidth, worldHeight)
cameraHud:setScale(CONF.cameraZoom)
cameraHud:setPosition(0,0)
if CONF.env == "release" then
sff.curstate=splash_screen()
else
if arg[#arg] == "-debug" then require("mobdebug").start() end -- allow debugging
io.stdout:setvbuf("no")
sff.curstate=menu()
end
end
function love.update(dt)
sff.curstate:update(dt)
end
function love.draw()
love.graphics.setColor(1, 1, 1, 1)
camera:draw(function() sff.curstate:draw() end)
cameraHud:draw(function() sff.curstate:drawHud() end)
end