A puzzle game for the PICO-8.
Go to file
Robert Miles 4fc1cbaf3a Begin work on puzzle 2 2019-01-28 20:05:50 -05:00
p8btools@4ca6b1c7a0 Initial commit 2018-07-13 08:41:40 -04:00
.gitignore Do not include built p8 cart in repo 2018-07-13 08:50:16 -04:00
.gitmodules Initial commit 2018-07-13 08:41:40 -04:00
LICENSE Add MIT License 2018-07-13 08:43:51 -04:00
Makefile Make combine.py only use main.lua (which will include all required files) 2018-09-03 03:16:16 -04:00
README.md Rename can_talk_to to can_trigger 2018-08-28 23:11:57 -04:00
base.p8 Begin work on puzzle 2 2019-01-28 20:05:50 -05:00
combine.py Fix broken combine 2018-09-03 03:17:29 -04:00
main.lua Begin work on puzzle 2 2019-01-28 20:05:50 -05:00
mapdata.lua Begin work on puzzle 2 2019-01-28 20:05:50 -05:00

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 the mapdata 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