Skip to content
japan edited this page Aug 26, 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,sprite) - sets map cell at x,y to sprite (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 Definiotions

X (In Code 0) - A Button
Z (In Code 1) - B Button
Q (In Code 6) - Select Button
E (In Code 7) - Start Button

DPad Definitions

Arrows to control the DPad,
UP (In code 2)
DOWN (In code 3)
LEFT (In code 4)
RIGHT (In code 5)

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

Example Program,

This is an example of a program that displays Hello World! in the log console

function code()
    log('Hello World!')
end
Clone this wiki locally