Tutorial by Examples

It's entirely possible to use PICO-8 as an interactive shell, but you probably want to tap into the game loop. In order to do that, you must create at least one of these callback functions: _update() _update60() (after v0.1.8) _draw() A minimal "game" might simply draw something on...
Although it's not officially supported, you can use mouse input in your games: function _update60() x = stat(32) y = stat(33) if (x>0 and x<=128 and y>0 and y<=128) then -- left button if (band(stat(34),1)==1) then ball_x=x ball_y=y...
If you want a title screen or an endgame screen, consider setting up a mode switching mechanism: function _init() mode = 1 end function _update() if (mode == 1) then if (btnp(5)) mode = 2 elseif (mode == 2) then if (btnp(5)) mode = 3 end end function _draw() cls() ...

Page 1 of 1