Skip to content

Instantly share code, notes, and snippets.

View sealgair's full-sized avatar

Chase Caster sealgair

  • Dark Horse Comics
  • Iowa City, IA
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sealgair
sealgair / music.lua
Last active August 20, 2016 02:53
pico 8 runtime music editing
--------------------------------
-- music
--[[ memory format:
0x3100 - song
each song is 4 bytes
the first bit of each byte is
a flag:
byte 1: loop start
byte 2: loop back
byte 3: stop
-- randomly choose item from table
function rndchoice(t)
return t[flr(rnd(#t))+1]
end
stars = {}
function makestars(n)
colors={1,5,6,7,13}
for i=1,n do
add(stars, {
-- class maker
function class(proto, base)
proto = proto or {}
proto.__index = proto
setmetatable(proto, {
__index = base,
__call = function(cls, ...)
local self = setmetatable({
type=proto
}, proto)