Develop on Pico-8

Getting Started - Tutorial / Guide / Awesome PICO-8 / Helpful Posts

caption

Keyboard Shortcuts

Ctrl+R Reload/Run/Restart
Ctrl+S Quick-Save

Lua

--[=====[ 
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

  • pq, a better PRINTH
  • tostr - Converts a non-string value to a string representation.

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.

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

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

Written on October 22, 2023, Last update on
pico8 game-engine lua procedural macintosh