Develop on Pico-8
Getting Started - Tutorial / Guide / Awesome PICO-8 / Helpful Posts
Keyboard Shortcuts
Ctrl+R
Reload/Run/Restart
Ctrl+S
Quick-Save
Lua
- Tables - Table index start at 1 in Lua
- How to turn tables - introduce table for sprite animation & bullet handling
- OOP
- Coroutines
- using External Editor
- multi assignment -
local x,y = 10, 11
- Multiline comments
- 16.16 fixed point numbers - need additional library for float
- lua errors - How to Read Error Messages
--[=====[
for k,v in pairs(t) do
local d = fullToShort[k]
local col = xColours[v[1]] -- It stops here!
cecho(string.format(("<%s>%s ", col, d))
end
--]=====]
Tips
Debug 🐛
Debugging tutorial
printh
- prints a string to the host operating system’s console. It is the single most helpful tool I know for pico-8 debugging.
see also
why not just PRINT
?
- If you PRINT during the _UPDATE half of your game, those prints will be overwritten by the CLS at the start of your _DRAW function.
-
You can PRINTH the same thing on multiple frames then scroll through the history in the host console.
- You can also inspect variable with print from pico8 console.
- and from code itself
print('score: '..score, 0, 120, 8)
- and from code itself
see also
echo
- a system for collecting and printing messages, only usefull when developing exclusively inside Pico-8
STOP
If you can’t set up a host console for some reason, STOP is an ok alternative to PRINTH.
using STOP()
in code will stop the interpreter. Then run “.” To single step. “R” to continue running.
Profiling
Tutorials
- HIVE PICO-8 Tutorial
- Pico-8 Tutorial Crash Course For TOTAL Game Dev Beginners! - general intro on tools available - very basic sprite move
- Let’s make a PICO-8 Game in 30 Minutes! - more complete overview
- how to reuse existing game to make your own - use celest movement (MIT Licenced)
- Programmer des mini-jeux avec PICO-8 ! Tuto pour débuter
- Programmer un shoot’em up !
- Programmer un jeu d’aventure à la Zelda
- moitié basse de la map / partagé avec les planche de sprites 3 & 4
Player controls
Using btn( [i,] [p] )
function _update()
if btn(⬅️) then x-=1 end --left
if btn(➡️) then x+=1 end --right
if btn(⬆️) then y-=1 end --up
if btn(⬇️) then y+=1 end --down
if btn(🅾) then a=true end--o
if btn(❎) then b=true end--x
end
Mouse
Keyboard
Pico-8 Feature review
see Versions
Compression & Packing
- PICO-8 Token Optimizations
- put all your game data into a string. = 1 token
- compressed size limit
- Shrinko8 / r/pico8 - A set of Pico-8 cart tools, with a focus on shrinking code size.
- From one Pico-8 cart to many
-
rectpack2D / HN - A header-only 2D rectangle packing library written in modern C++.
- PX9 / PX8 - PX9 is a lightweight gfx & map compression library, intended to replace PX8. It uses the same ideas and interface as px8, but is smaller (~297~x 214 tokens to decompress), and requires zero configuration.
- Picocraft: Pico8 Sprite and maps Tricks - Graphics Workflow with PX9
- Adventures in data compression (2021)
- My Compressor (2018)
- SRAM Smasher! (2018)
- Binary Image Compressor (2016)
Written on October 22, 2023, Last update on
pico8
game-engine
lua
procedural
macintosh