Robert Miles 4fc1cbaf3a | ||
---|---|---|
p8btools@4ca6b1c7a0 | ||
.gitignore | ||
.gitmodules | ||
LICENSE | ||
Makefile | ||
README.md | ||
base.p8 | ||
combine.py | ||
main.lua | ||
mapdata.lua |
README.md
blazzle
A puzzle game, for the PICO-8.
API Reference for the game functions:
mapdata
- contains data for all the maps in the form of:
x
,y
- The X and Y coords for the map. (Map screen coordinates / 16)n
,e
,s
,w
- The north, east, south, and west connections accordingly. An index into themapdata
table.triggers
- A list of triggers, in the form of{xcoord,ycoord,triggerfunction}
.
x
, y
- the player's location on screen, used for trigger events. Always a multiple of 8 unless something goes wrong.
f
- Facing. 0
=up, 1
=down, 2
=right, and 3
=left.
timer
- incremented once per frame
delay
- when non-zero, _update
increases timer
, decreases delay
and returns early
mapn
- number of currently active map
textbox
, otextbox(t,cb)
, qtextbox(l)
- see Textbox section below
change_map(n)
- purely descriptive function, sets mapn
to n
can_trigger(tx,ty,tf)
- checks if there is a trigger in front of the player, assuming x=tx,y=ty,f=tf
.
activate(tx,ty,tf)
- activates the trigger in front of the player, assuming x=tx,y=ty,f=tf
.
oob(tx,ty)
- checks if (tx,ty)
is outside of the screen.
solid(tx,ty)
- checks if the tile at (tx,ty)
is solid (flag 0)
move(dx,dy,df)
- sets f
to df
and attempts to affect T(dx,dy)(x,y)
_init
, _draw
, _update
- PICO-8 hooks
Textbox
textbox.open
- Is there an active textbox?
textbox.text
- Text in the textbox
textbox.cb
- function to call after closing textbox
otextbox(t,cb)
- sets textbox.open
to true
, textbox.text
to t
, and textbox.cb
to cb
qtextbox(l)
- used for text sequences, uses callbacks and recursiveness to go through all of the text in l