Log In  

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

Put a flip in it!

I stopped trying to be clever and just started rendering sectors from back to front using a breadth-first queue. Even though this overdraws more pixels, it ends up being faster than using portals to clip geometry, especially when there are things like stairs or plinths.

6
2 comments


The date() function returns a formatted date.

It takes three arguments

  1. format, the format to use for display (See: Programming in Lua 22.1 - Date and Time). Starting the format with ! makes it UTC, otherwise it will be local time.
  2. t, the timestamp either as a string (in the default UTC YYYY-mm-dd HH:MM:SS) or Unix timestamp (seconds since 1970-01-01 00:00:00)
  3. delta, an amount of seconds to add to the timestamp.

date() gets the current time in UTC, and is used to generate timestamps in Picotron (for modified and created times).

date("%Y-%m-%d %H:%M:%S", timestamp) converts timestamp to local time. (So you can store timestamps in UTC and later display them in local time)

date(nil, nil, -86400 * 10) subtracts 10 days from the current time.

Since timestamps are in YYYY-mm-dd HH:MM:SS format, they can be compared directly as strings.

[ Continue Reading.. ]

1
3 comments


Cart #bar_fight_ach-0 | 2025-01-16 | Code ▽ | Embed ▽ | No License
3

Made for the Trijam #304 - 1 Button Adventure in a little bit over of 3 and a half hours.

Use your randomly assigned movepool to defeat the enemy!

Basic Moves:

Attack - Deal 10 + Strength damage - Diamond Icon

Shield - Gain 10 Shield - Shield Icon

Heal - Gain 10 health - Heart Icon

Status moves:

Bite - Deal 5 + strength damage. Chance to inflict 1 Poision - Skull icon. Poision ticks periodically, hits hp directly.

Mock - Deal 5 + strength damage. Chance to inflict 1 Burn - Orange Yelpi icon. Flame hits periodically, hits shield first.

Slap - Deal 5 + strength damage. Chance to inflict 1 Confusion - Fist icon

Empower moves:

Taunt - Gain 2 shield. Gain 1 strength. - Blue Face icon.

Evade - Gain 2 shield. Gain 1 evasion. - Fog Icon. Evasion gives dodge chance.

Aim - Gain 2 shield. Gain 1 accuracy - Eye Icon. Chance to hit through evasion, and crit.

Healing moves:

Cleanse: Heal for 5. Cleanse 1 negative debuff - Green cross

Pray: Heal for 5, grants strength. - Blue Hands

Fatigue:

If the match goes long enough and incrementing fatigue starts to hit both combatants.

Support:

My awesome supporters over at

[ Continue Reading.. ]

3
3 comments


Cart #sunqueen-0 | 2025-01-16 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
7

Sun Queen

This is a game where you guide a dog around a park to soak up the sun wherever it appears and eat some bananas. It's dedicated to our Yorkie Silky dog named Daisy Mae, who passed away at the age of 14. Her favorite things in the world were - wait for it - sunshine and bananas.

How to play

Use the d-pad/arrow keys to move Daisy around. Try to stay within the sun spots as they grow and shrink for as long as possible to gain points before the timer runs out. Eating the bananas is optional but will get you 10 points.

Thanks for playing!

7
4 comments


Cart #linedefences-0 | 2025-01-16 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4

4
5 comments


Cart #conway_pvp-0 | 2025-01-15 | Embed ▽ | License: CC4-BY-NC-SA
4

This is a version of Conway's Game of Life with PVP support! It's inspired by/based on this DougDoug stream: A Crew VS. Z Crew in Conway's Game of Life.

The rules are very similar to regular Conway's Game of Life.

  1. Any living cell with < 2 living neighbors dies (underpopulation)
  2. Any living cell with 2 or 3 living neighbors lives
  3. Any living cell with > 3 living neighbors dies (overpopulation)
  4. Any dead cell with exactly 3 live neighbors lives (reproduction)

However, there are two colors, red and blue. For rules (2) and (4), when the cell lives, it will match the color of its adjacent cells. If there are more red adjacent cells, it will become red. If there are more blue adjacent cells, it will become blue. If there are an equal number of red and blue adjacent cells, it will randomly choose one.

[ Continue Reading.. ]

4
0 comments


Cart #sunnybirdgame-1 | 2025-01-15 | Code ▽ | Embed ▽ | No License
3

Hello! Just started using PICO-8 as a somewhat beginner programmer so I decided to make a small one screen game of my roommate's pet pigeon.

Hope I will get better with time!

3
3 comments


While creating a program that uses Lua tables, I found it troublesome to check values, so I created this.
It is convenient to save it with a name such as dprt.lua and use it by including it.

--If you no longer need the debug display, you can disable it all together 
--by changing DEBUG_FLG to false.
--Also, if you want to display it on the host, set DEBUG_TO_HOST to true
DEBUG_FLG = true
DEBUG_TO_HOST = true

function dprt(v)
	local function dbg(v)
		local buf, t, i = "", type(v), 0
		if t == "table" then
			buf = "table{"
			for i in pairs(v) do
				if v[i] != nil then
					buf = string.format("%s \n\t%s: %s", buf, i,dbg(v[i]))
				end
			end
			buf = string.format("%s \n},", buf)
		elseif t == "userdata" then
			buf = "userdata{"
			for i=0,#v-1 do
				buf = string.format("%s %s: %s", buf, i, dbg(v[i]))
			end
			buf = string.format("%s \n},", buf)
		elseif t == "number" then

[ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=160665#p)
1
0 comments


  • item 1

    Inicializar o tabuleiro vazio (8x8)

    tabuleiro = criar_tabuleiro(8, 8)

Gerar as primeiras 3 peças

pecas = gerar_pecas_iniciais()

Variáveis de controle

pontuacao = 0
fim_do_jogo = False

  • item 2
    def criartabuleiro(linhas, colunas):
    return [[' ' for
    in range(colunas)] for _ in range(linhas)]

def exibir_tabuleiro(tabuleiro):
colunas = 'ABCDEFGH'
for i, linha in enumerate(tabuleiro):
print(f"{colunas[i]} " + " ".join(linha))
print()

  • item 3
    def gerar_pecas_iniciais():
    pecas_possiveis = [
    [(0, 0), (0, 1), (0, 2)], # Linha reta
    [(0, 0), (1, 0), (2, 0)], # Linha reta vertical
    [(0, 0), (1, 0), (1, 1)], # L
    [(0, 0), (0, 1), (1, 1)] # T
    ]
    return [random.choice(pecaspossiveis) for in range(3)]

  • item 4
    def posicionar_peca(tabuleiro, peca, linha, coluna):
    if not verificar_espaco(tabuleiro, peca, linha, coluna):

[ Continue Reading.. ]

0 comments


  • item 1

    Inicializar o tabuleiro vazio (8x8)

    tabuleiro = criar_tabuleiro(8, 8)

Gerar as primeiras 3 peças

pecas = gerar_pecas_iniciais()

Variáveis de controle

pontuacao = 0
fim_do_jogo = False

  • item 2
    def criartabuleiro(linhas, colunas):
    return [[' ' for
    in range(colunas)] for _ in range(linhas)]

  • item 3
    def gerar_pecas_iniciais():

    Definir os formatos das peças (por exemplo, L, T, quadrado, linha)

    pecas_possiveis = [
    [(0, 0), (0, 1), (0, 2)], # Linha reta
    [(0, 0), (1, 0), (2, 0)], # Linha reta vertical
    [(0, 0), (1, 0), (1, 1)], # L
    [(0, 0), (0, 1), (1, 1)] # T
    ]
    return [random.choice(pecaspossiveis) for in range(3)]

  • item 4
    def posicionar_peca(tabuleiro, peca, linha, coluna):
    for (dx, dy) in peca:
    if tabuleiro[linha + dx][coluna + dy] != ' ':
    return False # A peça não pode ser colocada aqui (colisão)

[ Continue Reading.. ]

0 comments


Cart #gomosamozu-0 | 2025-01-15 | Code ▽ | Embed ▽ | No License
4

"ITANO Circus" like missiles.

Up/Down/Left/Right: Move the target dot.

4
2 comments


[sfx]

<br/>

My try on the first bit of the opening music of the anime: Frieren: Beyond Journey's End -- YOASOBI - 勇者.

Cart #frieren_music-0 | 2025-01-14 | Code ▽ | Embed ▽ | No License
1

1
0 comments


Side Quest 2 is broken down into 4 requests from the same villager. You first come across this Side Quest in "Lesson 6: Print to the Screen" and are encouraged to revisit it after learning how to use variables in "Lesson 7: Variables & Data Types". You are free to submit both examples under this post, but you should make it clear whether you made them with or without variables.

2-1
"Hi, I have a clothing store and I need a sign that shows people our fabric color options. Can you print the numbers 1 through 15 but in those exact colors for me?"

2-2
"I also do custom jobs where I can design someone's name into the fabric. Can you give me some ideas by printing your name, one letter at a time, in a really cool pattern?"

[ Continue Reading.. ]

1
2 comments


Hello everyone,

Here's my first upload to the BBS ever, it's a simple rewrite of the ls.lua util. I've always preferred using ls -al (that is usually aliased as ll) in my unix terminals and because the muscle memory is too strong, I've just remade it quickly in Picotron.

Let me know if you have any issue. I also wanted to add the 'rwx' info just as a joke, but it crowded the output a bit too much.

Just copy this code in 'll.lua' in '/appdata/system/util'

function lpad(nb, str)
	local nb_to_add = nb - #str
	local result = ""
	for k=0,nb_to_add do
		result = result.." "
	end		
	return result..str
end

cd(env().path)

local path0 = env().argv[1] or "."
path = fullpath(path0)

if (not path) then
	print("could not resolve path "..tostr(path0))
	exit(0)
end

local res=ls(path)

if (not res) then
	print("could not find path "..tostr(res))
	exit(0)
end

[ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=160609#p)
1
0 comments


I'm trying to do a simple state machine but I'm doing something wrong in the assign.
I wanna assign "running" if a button is pushed from a list of values.

player = {
	lives = 3,
	current_state,
	list_states = {"running","jumping","falling"}
}

function _update()
	if btnp(❎) then
		player.current_state = player.list_states["running"]
	end
end

function _draw()
	cls(1)
	print(player.current_state)
end

This doesn't work:
player.current_state = player.list_states["running"]

This works but its not very useful because I don't see in the code which state I'm assigning:
player.current_state = player.list_states[1]

This also works, but I think it's also not very useful because the usefulness of the state machine is assigning a concrete value from a set of predefined values to avoid mistakes.
player.current_state = "running"

How can i do it? Or whats the usual approach to make states machines?

Thank you!

3 comments


Cart #prehistoric_cantine-0 | 2025-01-13 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
6

Prehistoric Cantine - A 2 player coop game.

This is prehistory.

After school, the children play by the river and then go to eat in the school canteen. It's up to you to keep an eye on them and then take them to the school canteen.

Do everything you can to make sure kids don't fall into the water, bump into walls, or get swept away by dinosaurs.

When the bell rings, bring ALL the kids to the school canteen to take it to the next level!

Play with one controller per person or one keyboard for two.

--
French version is here :

[ Continue Reading.. ]

6
2 comments


Cart #sebastiansquest-0 | 2025-01-13 | Code ▽ | Embed ▽ | No License
23

kept this one under 500 lines of code, i think that's a new record for me

get that cheese 🧀

23
16 comments


Cart #cavebird-0 | 2025-01-13 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

About

  • Try to go the furthest distance!
  • Collect coins to brighten the cave!

Controls

  • Press any button on keyboard, gamepad or mouse to jump.
  • Press enter or start to pause.

Credit

  • Made by: MrDuckyWucky
  • Uploaded: Jan 12, 2024
  • Also on itch.io
5
0 comments


Cart #zorarasogi-0 | 2025-01-13 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

0 comments


Cart #jocsencat_bprint-0 | 2025-01-13 | Embed ▽ | License: CC4-BY-NC-SA
1

[CAT]
Hola a tots! He fet una petita utilitat per poder mostrar per pantalla els caràcters especials del català a Picotron. En concret afegeix suport per als caràcters:
ÀÈÉÍÓÒÚ àèéíòóú ÏÜ ïü Çç l·l

Sou lliures de modificar-la si voleu. Aquest cartutx és un exemple d'ús. Només cal:
1-Importar la llibreria al vostre cartutx
2-Importar-la al codi (com a l'exemple)
3-Ja podeu utilitzar les funcions de la llibreria. Són dues: bcursor(x,y) i bprint(text, [x], [y], [color])

[ Continue Reading.. ]

1
0 comments




Top    Load More Posts ->