funk/src/main.lua

32 lines
803 B
Lua
Raw Normal View History

2018-07-23 11:51:34 +00:00
_G.CONFIG = require("conf").properties
local log = require("log")
_G.pal = require("palette").getPalette("CADE-15")
local getSandboxEnv = require("sandbox")
2018-07-23 20:11:02 +00:00
local api = require("api")
function _G.sandbox(f)
2018-07-23 20:11:02 +00:00
local glob = getSandboxEnv()
for k,v in pairs(api) do
glob[k]=v
end
if f then setfenv(f,glob) else return glob end
end
local Cart = require("cart").Cart
local cart
2018-07-23 11:51:34 +00:00
function love.load()
require("cindy").applyPatch()
_G.scr = love.graphics.newCanvas(256,240)
cart = Cart:loadCart("test.lua")
2018-07-23 11:51:34 +00:00
end
function love.update(dt)
if love.keyboard.isDown("escape") then love.event.quit() end
cart.update()
2018-07-23 11:51:34 +00:00
end
function love.draw()
cart.draw()
2018-07-23 11:51:34 +00:00
love.graphics.setBackgroundColor(0,0,0)
love.graphics.setColor(255,255,255)
2018-07-23 12:56:13 +00:00
love.graphics.draw(scr,0,0,0,CONFIG.scalefactor,CONFIG.scalefactor)
2018-07-23 11:51:34 +00:00
end