It seems I'm using these a lot, so here they are:
----------------- -- table as string ----------------- function tab2str(t) local s="(" for i,v in pairs(t) do if type(i)=="number" then s=s.."["..i.."]=" else s=s..i..'=' end if type(v)=="boolean" then s=s..(v and "true" or "false") elseif type(v)=="table" then s=s..tab2str(v) else s=s..v end s=s..',' end s=sub(s,1,#s-1)--remove last comma return s..')' end ---------- -- example ---------- l={1,2,4,5,s=5} print(tab2str(l)) |
---------------- -- clone a table ---------------- function clone(t) local c={} for i,v in pairs(t) do c[i]=type(v)=="table" and clone(v) or v end return c end |
--------------------------------------------------- -- sort a table (insertion sort) -- cmp(a,b) should return true when a,b are ordered --------------------------------------------------- function insort(t,cmp) for n=2,#t do local i=n while i>1 and not cmp(t[i-1],t[i]) do t[i],t[i-1]=t[i-1],t[i] i-=1 end end end ---------- -- example ---------- function ascending_y(a,b) return a.y<=b.y end t={} for i=1,5 do add(t,{i=i,y=rnd(10)}) print(i..': '..t[i].i..' '..t[i].y) end print("----") insort(t,ascending_y) for i=1,#t do print(i..': '..t[i].i..' '..t[i].y) end |



This small Pico-8 tweetcart280 (278 chars in code editor without comments) is my homage/demake of Spike Dislike by Jayenkai. You can find the original one and lots of other games he has made here: agameaweek.com
Have fun!





An implementation of Rocket, from the Pairs Companion. The full rules are in the Pairs Companion, which you can download from Cheapass Games, but short version: there's 1 1, 2 2s, 3 3s, and so on through 10 10s in the deck. Don't get a pair.
The implementation actually works - up and down to change your bet, (X) to confirm, then (X) to hit or (O) to fold. There's some feedback now on what happened, but it's still pretty bare. I need to include actual in-game control notes, of course. And to make the art less hilariously awful. And maybe a nice card draw sound, hm.

ok so I think I get how people like pico 8 for its limitations. but will pico 8 ever support 4 players simultaneously?
this would be good for things like raspberry pi where 4 players can sit on a couch and play small 4 player games together.
what do you guys think?
I know older hardware only supported up to 2 players but I think this would be a good idea for the compactness of pico8.





Press X to switch to and from keyboard mode, where you control the cursor with the arrow keys and click with the Z key.
Some hints for if you get stuck:
-You can drag around everything on your desktop.
-Your virus can eat files and interact with the inside of some windows.
-Check your E-Chart to see your virus's status and progress.
-Good luck!
Made for the Virtual Pet Jam.

Hello everyone...
Got PICO-8 yesterday. I had never even heard about Lua. I'm not a coder (as everyone can see) :) but I thought the whole concept was interesting. I grew up with the 64 (though my first computer was a Laser 210), so obviously this is great fun.
Mini Ronin was a first stab at this, to see if I could even make anything that resembles a game.
Have fun! (And yes, the music can be turned off with the down key!) ;)
/ Pingo
Hello again!
Here's something I made this weekend - I recreated a pixel art image which was made by @Kldpxl:
https://twitter.com/Kldpxl/status/944196919643070464
I love his pixel art because it often has a really striking photographic look about it, so I tried to carry that effect over as much as I could.
Some features:
- It's 100% code: all sprites are generated at load time
- Textured ground plane with perspective distortion
- Value noise with multiple octaves (used for building all textures)
- Raymarcher for generating sprites with lighting:
- Four types of plants
- Background mountains
- Horizontally-tiling clouds
- 3D-positioned plant billboards
- 3D extrusion for low grass and road lines
I think it even runs at 60 fps!





Once the game loads, press either of Player 1's action buttons to begin playing. When the game is in progress, Player 2 can join by pressing either of the P2 action buttons.
This game was made in collaboration with Qendrim Hoti for our art show Galaxy Champion FUN ZONE. That exhibition centered around using modified/hacked video games to insert personal migrant histories into a variety of virtual worlds. Space Kilim was an game created by Hoti and I to explore how 8-bit graphics have an uncanny aesthetic similarity to the motifs found in woven rugs.
A kilim is a hand woven rug found in Morocco, Turkey, and Albania. The motifs used in the game are from a number of textiles in Qendrim’s collection.
In the art show where this was used, the game was played via a ceiling mounted projector which projected the game down onto a white fur rug. This is mostly why the game has no "interface" and no score-keeping: a simple and direct visual presentation in the gallery made more sense.
While no code was copied, this game was heavily inspired by this: https://ztiromoritz.github.io/pico-8-shooter/. Also, for now, the music was borrowed from Star Fox 2.
GO TO THE FUTUR MARTY! GO!!
Create in 1 Hour for the 144rd One Hour Game Jam with the theme Time Travel
Controls
X - Accelerate
O - Refuel
Itch Page : https://bigaston.itch.io/go-marty-1hgj

Making 40 Pico-8 carts in 2018! This is cart #4 (devlog).
A port of JP LeBreton's PETSCII Fireplace to the Pico-8, adapted from the source code which is available here.
If you think this kind of thing is cool then definitely check out Fireplace's parent project Playscii, JP's amazing ASCII art editor.

Throw Punch!! A one button fighting game for two players.
This was a little idea I had to try and make an interesting fighting game with only one button. The aim is to knock your opponent off the mountain. Both players gravitate towards each other and can press their button to throw their fist. When a player throws a fist it moves with the player's momentum plus a factor. However the fist decelerates then moves back towards the player fairly quickly, and your own fist can knock you backwards towards the edge! The idea is each player wants to press the button as late as possible but before their opponent... Or is it as simple as that?
Version 1.2 adds a little polish: a splash screen, a couple other stages, a transition between rounds and games and structures each game into 5 life stock battles.



Enjoyed Gamasutra's article on text reveals (http://ubm.io/2FsMjmn) and decided to implement the closest thing in #pico8 ! Lowest I could bring it to was 195 tokens. You could use clip() to further smoothen the text reveal, but I considered this version a good size/effect compromise.

I was just wondering everybody's opinion on the limitations of pico8?
right now there isn't really much we can do with it besides make very simple 1 level games.
pico8 could do much better if code limitations weren't so harsh.
also it seems people smash all there code together to preserve tokens which is not good
for example..
this takes up more space
local var = 0 var = var + 1 |
then this
local var=0 var=var+1 |
which makes no sense
if code limitations were removed and cart loading time was reduced significantly
then pico8 could make much larger games while still saving to a small cart size.
what would even be better if pico 8 carts were separated into 2 parts
- the compiled game
- and the dev files
so what do you guys think?
keeping the games small maybe be fun but you can only do so much with it especially with the severe limitations of pico8.










Upload version to transfer to Chip Pocket. no updates
Hi guys
Note: very novice coder. sorry of the mess.
I'm trying to recreate a childhood Fav game called BeamRider and I could really use some help understanding how
"FOR X IN ALL(Array) DO" works.
I need two types of bullets 1. Laser (short ranged) and 2. Nuke (for hitting the mothership)
I've made the array (bullets) to hold both "B" for Laser and "N" for nuke. which I need to behave differently for each other but my (bullets,N) keep over overriding my (bullets,B).
PLUS my Nuke are been draw but to my understanding of coding (which is novice at best) they should not been draw yet as I only have a (FOR B IN ALL BULLETS) in my _draw function. RAGE!!!
Is what I'm trying to do posible or do I need to make a second array for my nukes?

I'd like a way to move sprites in the map editor in a way that doesn't effect what is already drawn on the map.
It might be hard to understand what I mean and why you'd want it without an example.
I like to refer to sprites in code by their ID, and organize them by function to essentially act as free flags. For example I can put all passable map tiles in slots 0-15 (things like grass, roads, dirt) and all impassable map tiles in slots 16-31 (things like boulders, cliffs, water, walls), and use code to check the tiles directly in map data. If it's <16, the player can walk on it, if it's >15 then prevent movement.
I mean it's nice to just keep your sprites in a logical order anyway, right?
But if I need to add tiles later or shuffle things around within sprites, it changes the map. Move water where grass used to be and suddenly all the grass on the map is water.
What I would like is something like...when in the editor, ctrl+drag a sprite to another location, the two sprites swap, AND the map data is iterated over to swap the values there too. all 10s become 15 and all 15s become 10, that sort of thing. This would maintain what you have drawn in the map without having to redraw the whole thing.
And it's not just useful for referring to sprites by ID, it's nice if you need to move sprites around at any time, while maintaining the map.

Making 40 Pico8 carts in 2018! This is #2.
It's a scrolling demo/demake of the 1989 Amiga game Shadow Of The Beast. My goal was just to replicate the scrolling so there's no game as such but you can still wander around the looping landscape.
Devlog is here.




