Hello, I am hitting token count with my game so often - it is irritating. I feel like I am fighting a war of having clean code vs having less tokens.
(I understand that pico8 is for small games and first step should be cutting features though)
I am not sure if something is wrong or am I expecting too much and trying to use pico8 like modern framework.
In the docs is stated:
One program can have a maximum of 8192 tokens. Each token is a word (e.g. variable name) or operator. Pairs of brackets, and strings count as 1 token. commas, periods, LOCALs, semi-colons, ENDs, and comments are not counted.
Let's look at this code:
(taken from my game, but shortened and altered - don't expect this to work! I am not saying that provided code is greatest piece of clean, descriptive code!)
It draws (on local space - screen) piece of text, npc will say to the player - after delay, with black background to ensure readability.
draw_say=function(this,x,y)
x=this.x-x
y=this.y-y
palt(0,false)
foreach(this.draw_message_queue,function(obj)
local deltatime=gl_app_time.timeelapsed-obj.time
local text_len=#obj.m
local text_size=text_len*2
local text_time=text_len/4.0
local x1=x-text_size-2
local x2=x+text_size+2
local y1=y-12
local y2=y-4
if deltatime<text_time then
rectfill(x1,y1,x2,y2,0)
print(obj.m,x1,y1+2,obj.color)
end
end)
palt()
end,
|

So here is a question I have. There is this common issue in Pico-8 that comes up when you move things on the screen diagonally. If the vertical/horizontal speed is not an integer number the moving object will exhibit a jagged, jittery motion. This is due to the fact that Pico-8 doesn't do sub-pixel rendering. So the coordinates of objects snap to integer positions. In certain cases this leads to a kind of "stair-step" trajectory that can look very jittery.
My question: is there a good workaround to deal with this phenomenon? It is not always possible to use integer values for movement speeds after all.

hi,
i ve already got the pocket-Chip https://getchip.com/pages/pocketchip but its not really funny to play games on it cause of the controls. if you feel the same perhaps you are interested in this new kickerstarter projekt. its a gamining handheld based on a raspbery pi zero, so later you can install pico 8 on it :)
https://www.kickstarter.com/projects/583173617/raspi-boy-retro-handheld-emulation-console-electro
This is just a little demonstration written by my son, currently learning coordinate system at school and uploaded here for a presentation at school - nothing to see here, please move on ;)
-- koordinatenzeichner
-- von noah rottmann
-- koordinaten in einer tabelle
bild={}
bild[1]={4,4}
bild[2]={7,6}
bild[3]={4,8}
bild[4]={4,3}
bild[5]={2,3}
bild[6]={3,1}
bild[7]={7,1}
bild[8]={8,3}
bild[9]={4,3}
groesse=15
-- function zur zeichnung
-- des bildschirms
function _draw()
-- bildschirm loeschen
cls()
-- schleife von 1 bis menge
-- koordinaten -1
for i=1,#bild-1 do
-- linie von punkt i
-- bis punkt i+1
line(bild
Hi,
This is the first game make in pico8.
Instead of doing the tipical pong, decided to make a clone of the first racing game (that I know of) : Space Race from atari (1973).
2 PLAYERS CAN PLAY!
just use up and down arrows and E/D keys (player 1 and 2 respectively)
Please give me your comments
ENJOY!
It, would be convenient to be able to change what games appear on the top of my Favorites list. This what really help when handing someone new a pocketchip and show them pico8 so they can first see the games I think would get them to fall in love with the pocketchip and pico8 like mistigri and the adventures of jelpi
I'm not gonna be another growling at you about pico8 not being open source here aswell but at least fix HTTPS site wide.
No HTTPS on login and password changes is a huge security flaw and I'm stunned lexaloffle hasnt fixed this.
I can't imagine what other huge security holes are in pico8 waiting to be used to exploit pocketchip users.
captcha cat is cute tho. *ヽ(◕ヮ◕ヽ)

Hey All -- PICO-8 0.1.10 builds are now live on Lexaloffle and Humble!
Update: 0.1.10b is up with bugfixes for the html exporter. (Changes)
Update2: 0.1.10c is up with fixed atan2()
Multicart Exporter
The EXPORT command can now be used to create a single .js (and .html) file that contains more than one cart. All of the carts can read, write, and run each other as if they were local files loaded from PICO-8. To do this, add the names of up to 15 extra cartridges you'd like to include in the export: (.p8 format only in 0.1.10)
> LOAD MENU.P8 > EXPORT MEGACART.HTML JELPI.P8 DRIPPY.P8 CAST.P8 |
Inside the program, you can then use RELOAD() to grab data from other carts:
-- GRAB JELPI'S SPRITESHEET RELOAD(0,0,0x2000,"JELPI.P8") |

It was suggested I post this here, so I'm just going to copy/paste. This is a write-up on how I jumped some hurdles to make my rpg WaGa (having issues uploading the cart to here on my phone, I'll put it on soon)
PICO-8 and limitations
So, indie games are usually made to emulate older games, and follow similar restrictions. That's cool, but older games, at the time, were all trying to break past those restrictions, this gets a bit lost. PICO-8 is a platform given to us that attempts to force us to follow some restrictions, so now we get to make games exactly like older games: pushing those limits.
So recently I made an RPG for PICO-8, WaGa. I hit the token wall pretty quick. I had a lot of data, 50 some items, 8 enemies, enemy groups, stair exits, 4 characters with stats, and a bag that could hold items, and so on. PICO-8 follows a subset of lua, so I had to get fairly creative.
The biggest thing I found I could exploit, by far, is strings. One string is just a variable, and follows the same one token count as any other variable, this really opens things up. The only string function PICO-8 gives you is sub(), which is, as I found, all I needed to get done what I had to get done.
I did need a few other functions though. I needed explode, and I needed a string->number function. I think to myself, if I have these, I can have my entire set of items only take up one token! Had I really wanted to, I could have all of this a step farther, and had one huge database string itself, which i explode into datasets, which i explode into arrays.
Heres an example, my item dataset
--item

You are the infamous cat burglar Slyboots, and you've been forced out of retirement because copycats are making a mockery of your legacy. Show them who the real Slyboots is! Use the arrows key or gamepad to move, collect the treasure and exit. But which one are you?
Created by Jonathan Decker "Lokno" during Wizard Jam 4, a game jam put on by the Idle Thumbs Community.
Itch.io event page: https://itch.io/jam/wizard-jam-4
See the forum for details.
https://www.idlethumbs.net/forums/topic/11099-welcome-to-wizard-jam-4
Chase the kids back to their mat.
Arrow keys to move.
Z to scream, hold to increase radius.
Kids will run directly away from you.
Kids will run further from longer screams.
X to scoop the choup.
Kids left unattended will choup on the carpet.
16 choups and you lose.
100 points everytime you chase a kid back to the mat.
750 points every new level.
music from woo Pico-8 demo.
Dear all,
Can anyone see something wrong with this line of code...
if (sub(m[n],f,f)="1") then rect(f*5,n*5,(f*5)+5,(n*5)+5) |
...as it's giving me this syntax error...
')' EXPECTED NEAR '=' |
It sits in this nested loop:
for n=1,10 do for f=1,15 do if (sub(m[n],f,f)="1") then rect(f*5,n*5,(f*5)+5,(n*5)+5) end end |
Any help much appreciated as my eyes have dried out looking at it!
tobo






11 comments

