51 lines
966 B
Lua
51 lines
966 B
Lua
pico-8 cartridge // http://www.pico-8.com
|
|
version 41
|
|
__lua__
|
|
|
|
-- vacuum gambit automatic brake test
|
|
-- by kistaro windrider
|
|
|
|
function usplit(str)
|
|
return unpack(split(str))
|
|
end
|
|
function csv(s)
|
|
local ret = split(s, "\n")
|
|
for i, v in ipairs(ret) do
|
|
ret[i] = type(v) == "string" and split(v) or { v }
|
|
end
|
|
return ret
|
|
end
|
|
|
|
-- generate standard "overlay"
|
|
-- constructor for type tt.
|
|
-- if more is defined, generated
|
|
-- new calls more(ret) after
|
|
-- ret is definitely not nil
|
|
-- before calling setmetatable.
|
|
-- use to initialize mutables.
|
|
--
|
|
-- if there was a previous new,
|
|
-- it is invoked on the new
|
|
-- object *after* more, because
|
|
-- this works better with the
|
|
-- `more` impls i use.
|
|
function mknew(tt, more)
|
|
local mt, oldnew = { __index = tt }, tt.new
|
|
tt.new = function(ret)
|
|
if (not ret) ret = {}
|
|
if (more) more(ret)
|
|
if (oldnew) oldnew(ret)
|
|
setmetatable(ret, mt)
|
|
return ret
|
|
end
|
|
end
|
|
|
|
function init()
|
|
end
|
|
|
|
function _update60()
|
|
end
|
|
|
|
function _draw()
|
|
end
|