Skip to content
Piter edited this page Sep 4, 2021 · 14 revisions

Welcome to the PityBoy wiki!

Feel to free expanding this wiki!

Syntax:

log(any text) - writes text to console/stdout
time()        - returns elapsed time in milliseconds from start
setmapx(x)    - sets map x on screen
setmapy(y)    - sets map y on screen
getmapx()     - returns map x
getmapy()     - returns map y
setmapd(bool) - sets map visibility on screen
getmapd()     - returns map visibility
setmapi(i)    - sets current visible map (0-3)
getmapi()     - returns current visible map (0-3)
setmap(x,y,tile) - sets map cell at x,y to tile (0-255)
getmap(x,y)   - returns map cell (0-255)
sprite(sp,x,y,transparency,scale,flip) - displays sprite at x,y, Transparency is color that will be transparent
key(k)        - returns true when key is pressed (0-7)
halt()        - halts PityBoy
exit()        - exit

Key() function Definitions

Keyboard PityBoy Key() code
X A Button 0
Z B Button 1
UP D-Pad up 2
DOWN D-Pad down 3
LEFT D-Pad left 4
RIGHT D-Pad right 5
Q Select Button 6
E Start Button 7

Project folder structure:

project.info Contains information about project and will be mainly used for upcoming website
code.lua Not created by default. Entire script is called once on launch and every frame (60 per second) function code() is called
sprites.pit Sprites file, First 6 bytes is header and version
map0-3.pit Maps, First 6 bytes is header and version