Initial commit

This commit is contained in:
Robert Miles 2018-07-13 08:41:40 -04:00
commit 810100abab
6 changed files with 43 additions and 0 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "p8btools"]
path = p8btools
url = https://git.tilde.team/khuxkm/p8btools

8
Makefile Normal file
View File

@ -0,0 +1,8 @@
NAME:=blazzle
SRC:=$(wildcard *.lua)
$(NAME).p8: $(SRC)
python combine.py $(NAME).p8 base.p8 $(SRC)
.PHONY: clean
clean:
rm $(NAME).p8

4
base.p8 Normal file
View File

@ -0,0 +1,4 @@
pico-8 cartridge // http://www.pico-8.com
version 16
__lua__

18
combine.py Normal file
View File

@ -0,0 +1,18 @@
import p8btools,argparse,io
parser = argparse.ArgumentParser(prog="python combine.py",description="Combines a lua file into a .p8 cart.")
parser.add_argument("result",help="The filename for the resulting cart.")
parser.add_argument("p8cart",help="A .p8 cart.")
parser.add_argument("luafile",help="The lua file to inject into the .p8 cart.",nargs="+")
args = parser.parse_args()
cart = p8btools.Cart(args.p8cart)
t = ""
for luafile in args.luafile:
lua = p8btools.LuaCode(luafile)
lua.parse()
t += lua.text
t += "\n"
cart.lua = t.rstrip()
with io.open(args.result,"w",encoding="utf-8") as f:
f.write(cart.fulltext)

9
main.lua Normal file
View File

@ -0,0 +1,9 @@
--!define pico8 1
--!ifndef pico8
print("This is a PICO-8 cartridge, stupid.")
--!endif
function _update() end
function _draw()
cls(0)
end

1
p8btools Submodule

@ -0,0 +1 @@
Subproject commit 4ca6b1c7a063a6a834ed709d2d1327bf68c68c3d