Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-------------------------------- | |
-- 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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, { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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) |