There are many ways to loop over an array-style table. For example:
local tab = {10,20,30,40} -- method 1 local calc1 = 0 for i,elem in ipairs(tab) do calc1 += i*elem end -- method 2 local calc2 = 0 for i=1,#tab do local elem = tab[i] calc2 += i*elem end |
Which way is fastest? Well it often doesn't matter, since the work inside the loop usually far outweighs the cost of the loop itself. Or tokens might matter more to you than speed. But in some situations you want your code to be as fast as possible, and that means minimizing the overhead from the loop itself.
Setup
So, which way of looping is fastest? Here are the methods we'll compare:
function for_i(tab) for i=1,#tab do local x=tab[i] -- do some work end end function for_all(tab) for x in all(tab) do -- do some work end end function for_ipairs(tab) for i,x in ipairs(tab) do -- do some work [ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=164729#p) |




Survive the chaos as long as you can
Blast off in your space ship in this Geometry Wars inspired roguelite where every run counts. Defeat the alien dreadnoughts and recover the powerful Titan ship... if you can manage the chaos.
This is my first PICO-8 game. Lmk what you think! Total play time is probably ~15-25 minutes if you want to unlock everything.
Controls:
- Don't move to shoot.
- PRESS X TO USE A POWER UP
How to play:
- Shoot ships to earn coins in each run.
- Unlock the four ships with coins.
- Get cooler weapons.
- Have fun.
Running a mission:
- Avoid the enemy ships.
- Stop moving to shoot.


--for the best experience, play with headphones on.
--ABOUT--
Goom is a small, and yet challenging and fun demake of Doom, a popular fps.
you will run around a small room, defeating waves of enemies until you reach the final boss.
you can shoot using your mouse and run around the map with either the arrow keys, or esdf.
watch your ammo too, as you only have a little bit. however, ammo is restored each round. not your
lives though, so watch out for bullets, and dont get to close to the enemies!
and dont worry, your highscore will be saved!


--CREDITS--
this game was made by Dominic!
1024 bytes
A pico-8 game developed for the Pico 1k Jam 2024.
Combine like-numbered tiles to reach tile 1024 before the grid gets full.

Controls
- Up/Down/Left/Right to move the tiles
Credits
Written by: Greg Gaughan
Idea from 2048 by Gabriele Cirulli
Vault 0 is a spooky text-based-choose-your-own-adventure game with 12 endings.
Explore a strange forest in search of a mysterious device.
This was my first Pico8 project and it was a BLAST! Super fun stuff.
Also, Vault 0 is a Pico8 Demake of my own game: Vault. If you want to play some different versions of this game:
- Jam Edition, 2024: https://keveatscheese.itch.io/vault
- Full Version, 2025: https://keveatscheese.itch.io/vaultsteam
Lastly, I have a discord server if you want to follow development: https://discord.com/invite/NPnaERQQSy





If you like this game, please consider supporting on itch !
This is my Rubik's cube implementation in PICO-8 fantasy console. Back in 2023/2024 I did a Rubik cube in OpenGL but in November of 2024 I decided to learn about PICO-8 and practice about my 3D computer graphics skills, so I came up with this type of game again hahah.
After a quick search, I founded that many people already did a Rubik's Cube, but always for 3x3x3 dimensions. The same thing applies for textures and solid colors.
In PICO RU8IK you can solve from a 1x1x1 cube up to 10x10x10 Rubik' cube. Also it's very customizable and CPU efficient




I am new to PICO-8 and coding in Lua under its environment. I was wondering, if putting in comments and keeping long names for variables and functions steals memory from the system.
What I know that usually Lua compiles the source code before executing it. All the source code is converted in tokens. But is it the same in PICO-8, I mean, is it stored in ASCII format or in tokens inside the memory?
Is it a good practice to keep short names and minimal comments?
Thank you.

(Based on https://www.lexaloffle.com/bbs/?pid=85376#p)
This version of Alpine Ascent makes the game harder
Features:
-Frame Counter
-Debug
-Best Frame saving
(My record is 5982 Frames)
Old Versions:
V1.0:

Based on this video:
https://www.youtube.com/watch?v=ZZY9YE7rZJw
Generates a procedural universe - with many suns, planets and moons.
And additional to the video, name suns and populated planets.
I used the rnd and srand-function from pico8 instead of the own function.
You can move with the cursor-keys and click on the suns for more details.
This is a WIP that has sat in my folder of shame since 2018. Because I bit off more than I can chew, I never finished it, but my goal was to have a complete RPG experience with random encounters that were arcade shooter in nature.
It's basically functional, but some doors spit you out in the wrong spot, monsters get ridiculously hard because nothing was ever balanced out, and it's generally just the result of a designer having more ideas than technical aptitude.
Run around the world, get into fights. If you capture a bug with the Captchahedron beam (they're easier to capture if they're hurt) it'll fight with you until it dies in battle.
I'm basically going to publish all my WIPs to the forum over the next week because they're not doing any good dying on my hard drive and who knows, maybe they'll inspire the next dev. -Cephie


Welcome to my first game, DEMONCORE!!!!!
I have no experience with game design, but this project has been incredibly fun! A big thank you to LazyDevs and their schmup tutorial. I am excited to try the others on their channel. Go check it out: Here's a link to the video tutorial for making a beginner schmup
Controls:
z/O: Missiles
x/X: Blaster
Arrow Keys: Movement
Lore:
DemonCore is about a lone ship's quest to vanquish the demonic forces created by the Arch Demon Core. Splatter and explode your path through space, collecting demon cores from fallen foes as you do. The more darring you are, the higher chance a demon's splattered remains will relinquish their core. Each core you gather will reload a missile for your ship, so keep blastin' those down range. Collect a set of 6 cores and heal damage done to your craft. However! When undamaged, collecting 6 demon cores will grant your ship's energy source an increased power output! Staying unhurt is your best path to victory.

Picomonsters me ha gustado tanto que lo he traducido enterito.
La verdad es que para ser un juego de Pico - 8 es una pasada, esta muuyy currado. Mogollón de mecánicas del primer pokemon están perfectamente programadas, capturar monstruos, sistema de batallas, objetos,, misiones, etc...
Tabla de Elementos
Un picomonstruo de agua es fuerte contra uno de fuego
Los picomonstruos de fuego arrasan con todo salvo los de agua
Los de aire vencen a los de tierra
Los de tierra no valen pa nah



Kronos 1.0, Lightweight Timer Manager for PICO-8

What is Kronos?
This is my first experiment with PICO-8, one of the basic element of an application, as I am used to work.
Kronos is a fast, simple timer manager. It allows you to schedule delayed or recurring actions using a simple and intuitive API.
Whether ou're creating game logic, effects, cutscenes or test harnesses, Kronos lets you easily manage multiple timers, track their status, and trigger custom functions when they expire.
How It Works.
Kronos maintains an internal list of timers, each with:
- A unique ID (either auto-assigned or manually specified).
