Log In  

BBS > Superblog
Posts: All | Following    GIFs: All | Postcarts    Off-site: Accounts

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)
5
5 comments


HI! im making a little demo inspired by old terminals and i had this idea that you can see the character's reflection in terminal screen. however, if i draw the reflection before anything else, it covers the reflection, and if i place it after, well, the reflection now obstructs everything else.

Cart #madurorad-0 | 2025-03-29 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

So the idea is to looks something like this:

so i remembered a few carts that did same trickery of layering colors without obstruction, but with new color in result. fair enough, i found this cart on Zep's ambassador page.

Cart #gagiperuki-1 | 2025-03-29 | Code ▽ | Embed ▽ | No License
1

[ Continue Reading.. ]

1
2 comments


Cart #sehegegdo-2 | 2025-03-31 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

2
0 comments


Cart #saniwagono-2 | 2025-04-02 | Code ▽ | Embed ▽ | No License
2

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.

[ Continue Reading.. ]

2
3 comments


--for the best experience, play with headphones on.

Cart #gutihebeso-0 | 2025-03-30 | Code ▽ | Embed ▽ | No License
8

--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!

[ Continue Reading.. ]

8
0 comments


Cart #g1024bytes-0 | 2025-03-30 | Code ▽ | Embed ▽ | No License
10

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

10
0 comments


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.

Cart #vault0-0 | 2025-03-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
11

Also, Vault 0 is a Pico8 Demake of my own game: Vault. If you want to play some different versions of this game:

Lastly, I have a discord server if you want to follow development: https://discord.com/invite/NPnaERQQSy

11
3 comments


If you like this game, please consider supporting on itch !

Cart #pico_ru8ik-4 | 2025-06-08 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
10

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 applied for having textures in the pieces.

In PICO RU8IK you can solve from a 1x1x1 cube up to 10x10x10 Rubik' cube. Also it's very customizable and CPU efficient!

[ Continue Reading.. ]

10
10 comments


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.

1
2 comments


Cart #alpineascentx-1 | 2025-04-01 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4


(Based on https://www.lexaloffle.com/bbs/?pid=85376#p)
This version of Alpine Ascent makes the game harder

Features:
-Frame Counter
-Debug

(Press DOWN when starting)

-Best Frame saving

(My record is 5982 Frames)

Old Versions:
V1.0:

Cart #alpineascentx-0 | 2025-03-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4

4
1 comment


Cart #bubidayode-0 | 2025-03-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

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.

3
0 comments


Cart #suyrijej-1 | 2025-03-31 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

1
0 comments


Cart #dretowege-6 | 2025-04-08 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

Cart #dretowege-4 | 2025-04-01 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

Cart #dretowege-2 | 2025-03-31 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

Cart #dretowege-1 | 2025-03-31 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

my mini draw soft,i'm happy to share this

[ Continue Reading.. ]

2
5 comments


Cart #lexicon-0 | 2025-03-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

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

2
2 comments


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

Cart #dizimeroga-1 | 2025-04-14 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

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.

[ Continue Reading.. ]

5
1 comment


Working on a demake version of Sims. Currently it supports some basic actions and movement using a BFS algorithm. The UI is very simple, but the next next is to improve it and make the actions interact with the needs (energy, hunger, ...)
Feedback is welcome.

5
4 comments


Cart #fazazahije-1 | 2025-05-31 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

Cleese and the Dragon

This is an ongoing project for a top-down adventure game. With his great dane, Pike, and a magical shotgun to help him. Story by Mark Muller.

Media

1
2 comments


Cart #senbfija-2 | 2025-04-03 | Embed ▽ | License: CC4-BY-NC-SA
5

I fixed the bug concerning the climbing function and I made some minor corrections. Sorry technohat, thinking about it twice, I preferred to keep the game in the spirit of those of the time like those that Bob Withers & Stephen O'Dea made: working with only 2 words for the actions. It's mainly that I have little time to do it differently and I'm not a very advanced programmer. Here, I mainly wanted to recreate a small text adventure game with graphics to give me an idea of ​​how it could look on the picotron console. The result is really cool! To succeed in the game, you must especially take note of all the possible verbs to use (they are all revealed after the intro of the game). I added in the update more feedback from the game because, when we did not do the right actions, the computer returned nothing to explain what was really happening. Now it is basically improved!

5
4 comments


Cart #picomonstruos-1 | 2025-04-01 | Code ▽ | Embed ▽ | No License
6

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

6
4 comments


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.

Cart #kronos_scheduler-0 | 2025-03-29 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

How It Works.

Kronos maintains an internal list of timers, each with:

  • A unique ID (either auto-assigned or manually specified).

[ Continue Reading.. ]

3
2 comments




Top    Load More Posts ->