Log In  

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

Cart #cozy_winter_games-0 | 2025-01-26 | Code ▽ | Embed ▽ | No License
3

Welcome to the Cozy Winter game!

Controls
to move press the Left, Right, Up and Down keys.
In Cookie Printer, move and press X to shoot!
In Pong, the first player plays with Up and Down, the second player plays with N and M.
In Snow Ball, just use the direction keys.

Credits:
Made by Jachym and Ghazal,
For Cozy Winter Jam 2025

3
0 comments


As part of a project I'm working on, I wrote a quick json parser that loads a json file into a picotron table and thought it might be worth sharing.

E.g.

{
	"a":{"b":1,"c":-3.5},
	"d":["e",true,false]
}

is converted to:

{
	a={
		b=1,
		c=-3.5
	},
	d={"e",true,false}
}

So if you have some data in json format already, it's easy enough to load in. Hopefully a bit useful for storing configurations or data needed by carts outside of the code itself for neatness.

It should follow json specifications (e.g. whitespace outside of strings doesn't matter), and any null values will be handed as picotron's nil - however, because of the ways nils are added to tables, they won't work/appear in the way it does in the json itself.

Also, if the parser runs into any issues, it tries to offer some helpful errors to identify where the problem is.

I've done some light testing of the code, but let me know if you run into any issues with it.

Code is hidden below:
[hidden]

function init_json_reader()
	J_WHITESPACE = {}
	J_WHITESPACE[" "]=true
	J_WHITESPACE["	"]=true
	J_WHITESPACE[chr(10)]=true
	J_WHITESPACE[chr(13)]=true

	J_START_TABLE = "{"
	J_STOP_TABLE="}"
	J_START_LIST="["
	J_STOP_LIST="]"
	J_QUOTE="\""
	J_COLON=":"
	J_COMMA=","
	J_OBJ_STARTS={
		n=read_json_null,
		t=read_json_true,
		f=read_json_false,
	}
	J_OBJ_STARTS[J_QUOTE]=read_json_key_string
	J_OBJ_STARTS[J_START_TABLE]=read_json_table
	J_OBJ_STARTS[J_START_LIST]=read_json_list
	J_OBJ_STARTS["-"]=read_json_number

	for i = 0,9 do
		J_OBJ_STARTS[tostr(i)] = read_json_number
	end
	json_init = true
end

function load_json_file(filepath)
	-- Load and read a json file and return a list or table
	if not json_init then init_json_reader() end
	local text = fetch(filepath)
	assert(text!=nil,"Failed to load json file: "..filepath)
	return read_json(text)
end

function read_json(string)
	if not json_init then init_json_reader() end
	-- Read a json string and return a list or table.
	if #string == 0 then
		return nil
	end

	local i=skip_json_whitespace(string,1)

	if string[i] == J_START_TABLE then
		return read_json_table(string,i)
	elseif string[i] == J_START_LIST then
		return read_json_list(string,i)
	else
		assert(false,"Unexpected initial character encountered in json file: "..string[i])
	end
end

function skip_json_whitespace(string,i)
	-- Skip to the first non-whitespace character from position i
	while J_WHITESPACE[string[i]] do
		i+=1
		assert(i<=#string,"Unexpectedly hit end of file while skipping whitespace\nin json file")
	end
	return i
end

function read_json_table(string,i)
	local eot = false
	local tab = {}
	local k, v = nil, nil

	if string[i]==J_START_TABLE then
		i+=1
	end

	while not eot do
		k, v, i = read_json_table_entry(string, i)
		tab[k] = v
		i = skip_json_whitespace(string,i)
		if string[i]==J_COMMA then
			i+=1
		elseif string[i]==J_STOP_TABLE then
			i+=1
			eot=true
		else
			assert(
				false,
				"Unexpected character encounted after reading json entry with\nkey '"..tostr(k).."': "..tostr(string[i]).." "
			)
		end
	end
	return tab, i
end

function read_json_table_entry(string, i)
	local k, v = nil, nil
	i = skip_json_whitespace(string,i)
	k, i = read_json_key_string(string,i)
	i = skip_json_whitespace(string,i)
	assert(
		string[i] == J_COLON,
		"Expected colon following json key '"..k.."', found: "..string[i]
	)
	i = skip_json_whitespace(string,i+1)
	assert(
		J_OBJ_STARTS[string[i]]!=nil,
		"Unexpected value encounted while reading json entry\n'"..k.."', found: "..string[i]
	)
	v,i=J_OBJ_STARTS[string[i]](string,i)
	return k, v, i
end

function read_json_key_string(string,i)
	assert(
		string[i]!=J_STOP_TABLE,
		"Table ended while expecting entry, make sure you don't have a misplaced comma."
	)
	assert(
		string[i]==J_QUOTE,
		"Expected json key/string to start with double quote,\ninstead found: "..sub(string,i,i+10).."..."
	)
	i+=1

	local s = i	

	while string[i]!=J_QUOTE do
		i+=1
		assert(
			i<=#string,
			"Encountered end of json while reading key/string:\n"..sub(string,i,i+10).."..."
		)
	end
	return sub(string,s,i-1), i+1
end

function read_json_list(string, i)
	local eol = false
	local lis = {}
	local value = nil

	if string[i]==J_START_LIST then
		i+=1
	end

	while not eol do
		i = skip_json_whitespace(string,i)
		assert(
			string[i]!=J_STOP_LIST,
			"List ended while expecting entry, make sure you don't have a misplaced comma."
		)
		assert(
			J_OBJ_STARTS[string[i]]!=nil,
			"Unexpected value encounted while reading json list,\nfound: "..sub(string,i,i+10).."..."
		)
		value,i=J_OBJ_STARTS[string[i]](string,i)	

		add(lis,value)

		i = skip_json_whitespace(string,i)
		if string[i]==J_COMMA then
			i+=1
		elseif string[i]==J_STOP_LIST then
			i+=1
			eol=true
		else
			assert(
				false,
				"Unexpected character encounted after reading json list entry: "..string[i]
			)
		end
	end
	return lis, i
end

function read_json_null(string,i)
	assert(sub(string,i,i+3)=="null","Was expecting to read null during json file read, instead\nfound: "..sub(string,i,i+10).."...")
	i+=4
	return nil, i
end

function read_json_true(string,i)
	assert(sub(string,i,i+3)=="true","Was expecting to read true during json file read, instead\nfound: "..sub(string,i,i+10).."...")
	i+=4
	return true, i
end

function read_json_false(string,i)
	assert(sub(string,i,i+4)=="false","Was expecting to read false during json file read, instead\nfound: "..sub(string,i,i+10).."...")
	i+=5
	return false, i
end

function read_json_number(string,i)
	local s = i

	while not (
		J_WHITESPACE[string[i]] or 
		string[i]==J_COMMA or 
		string[i]==J_STOP_TABLE or
		string[i]==J_STOP_LIST
	) do
		i+=1
		assert(i<=#string,"Unexpectedly hit the end of json string while reading a number.")
	end

	return tonum(sub(string,s,i-1)), i
end

[ Continue Reading.. ]

3
2 comments


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

How to Play

Use the mouse to connect 3 or more adjacent gems of the same color (horizontal and vertical connections only). There are 2 modes, Normal and Timed. In normal mode, the goal is to clear 100 gems to finish the game. In timed mode, the goal is to clear as many gems as possible within 60 seconds.

Scoring

In normal mode, the ending pop-up shows how much time it took to clear 100 gems. In timed mode, the ending pop-up shows how many gems were cleared within 60 seconds. Please share your score screenshot as a comment! :)

Dev Notes

This is my very first game for PICO-8 and my very first project that is open source. Feedback and suggestions about the game and the source code are greatly appreciated as I am eager to grow and learn. Thank you!

4
5 comments


Cart #gianicolo-5 | 2025-01-28 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
8

Experience what it is like to fire the cannon of the Gianicolo hill in Rome, which since 1st of December 1847 fires at noon to synchronize clocks.

8
1 comment


Cart #bubble_existence-0 | 2025-01-26 | Code ▽ | Embed ▽ | No License
18

What Is It Like to Be a Bubble?

A meta-interrogation of the physiological patterns, intra-structural semantics, and conscious fabrics of nothingness pockets.

With BULLET HELL ACTION🔥🔥🔥

A game by Team Peaceful Bubble for Global Game Jam 2025. Made at the Let's Games! Tokyo site in Tokyo, Japan.

Credits

@acedio - Programming
@douglasdriving - Programming, Writing
@kitasuna - Programming, Level Design
@mabbees - Programming, Music
Shane - Art

18
2 comments


Cart #hm118_ggj25_cactus-4 | 2025-01-26 | Code ▽ | Embed ▽ | No License
2

Guide your cactus to the skies, being careful to maintain enough water and enough air to stop the bubble bursting.
Uses left and right arrow keys to move (keyboard) or d-pad(controller)
Tap x (keyboard) or a/x (xbox or ps controller) to spend resources to move upwards
Use x (keyboard) or a/x (xbox or ps controller) to start/replay

How high will you get?


Made for Global Game Jam 2025 "Bubble"

2
1 comment


Cart #caroucoroa-1 | 2025-01-26 | Code ▽ | Embed ▽ | No License
1

🇧🇷
um joguinho simples de cara ou coroa que eu fiz! o código é bem curto, então se você for brasileiro e estiver começando, espero que isso ajude de alguma forma!

🇨🇳
a simple little game of heads or tails i made! the code is very short, so if you're brazilian and just starting out, i hope this somehow helps!

disclaimer: i don't know the rules of language in the forums, but please let me know if I infringed any of them and i'll gladly update my post!

1
0 comments


observed: a function definition in which there's a line break between the function keyword and the name will not be visited when using alt+up and alt+down
expected: it will jump to the line with function on it

i use this convention to maximize the space i have for writing parameter lists so that i don't have to scroll horizontally, and to me this is the most aesthetically pleasing place to insert a line break

0 comments


Cart #spaceraceplace-0 | 2025-01-26 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

1
0 comments


by xyz
Cart #sq00-0 | 2025-01-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

1 comment


Cart #afloat-0 | 2025-01-25 | Embed ▽ | No License


WIP for Global Game Jam. Theme this year is Bubble

0 comments


Cart #ggj2025_ai_bubble-0 | 2025-01-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

TJ: OH MY GOD GAL THE GGJ WAS TODAY!

GAL: What?

TJ: THE GLOBAL GAME JAM! I overslept! God! I need the prize money we gotta GO GO GO.

GAL: Prize money? what the hell are you going on about?

TJ: THE PRIZE MONEY! To cover my severe gambling debt!

GAL: Gambling debt?

TJ: OK, here's the deal, let's just give the prompt theme to ChatGPT and see what comes-

GAL: It's already done.

TJ: What? ChatGPT did it that fast?

GAL: No. We've been working on this thing for 2 days. You just slipped and fell on the way to make coffee and I think you have a concussion.

TJ: That would explain why everything is purple...


Hi everyone! We made this! It's a game where YOU get to be the AI.

[ Continue Reading.. ]

1
0 comments


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

0 comments


Cart #mazequest-1 | 2025-01-25 | Code ▽ | Embed ▽ | No License
3

This is a game I made over Christmas Break!
Collect Coins, get keys, open doors, and complete the maze!

3
0 comments


Cart #destroyallmonstersmelee-0 | 2025-01-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2


So... i may have made a Rom hack of "Jelpi Extended" by NOTCL4Y... which is a hack of the original Jelpi demo...

Here it is i guess

that's all, bye, have fun.

ok fine, description.

-STORY-
Some Flying Centipede things is attacking Jokyo City, but that city is for you to destroy, not them, so kill em'!

-CONTROLS-
...you can guess...there's like 2 buttons and a d-pad, so figure it out yourself.

-ITEMS-
[8x8]
-COP CARS-

[ Continue Reading.. ]

2
0 comments


Sharing results of learning Pico8!

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

6
4 comments


Cart #amatkinsdrmmm-2 | 2024-08-29 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

Introduction

Mary Raleigh (Dr. Roly Poly), a whimsical professor of robotics engineering, has developed a game to teach her students concepts in automation. The aim of the game is to guide a marble through a maze using only a small set of context-based rules. You can try to solve the various challenges she’s devised or make your own!

Control Terminology

Term................controller / keyboard / mouse

Navigation..........d-pad / arrow keys / mouse
Primary button......O button / Z or C key / left mouse button
Secondary button....X button / X or V key / right mouse button
Menu button.........options button / enter key / middle mouse button

Quick Guide

The main game is a series of challenges available from the main menu. Open challenges will appear with a name and illuminated preview. Simply press the primary button to play it. Completing unfinished levels will unlock new ones.

[ Continue Reading.. ]

3
1 comment


Cart #matchdice-0 | 2025-01-24 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

Rules

You have 10 roll attempts to match the current target. If you succeed you win Points!
Try to gain as many points as you can!

If you exceed 10 rolls you will lose points and the target will be reset

Controls

Left and Right to move the cursor

Button O to roll all dice
Button X to roll selected dice

Up button to reset Target. Deducts 5 points.

2
0 comments


Cart #myjelpilevel-0 | 2025-01-24 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

1
3 comments


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

Mate in 1-2-3 vol.1

each level is a mate in 1, a mate in 2, and a mate in 3.
50 levels for a total of 150 puzzles.

progress saves with each puzzle.

about the puzzles and the code


These puzzles were collected from the lichess api. This is easier than manually pulling them from books, but unfortunately lichess only provides the pgn, not the fen. So there is still a tedious step. But I should be able to make more chess puzzlers a lot faster than before. @toadofsky had talked about getting live lichess puzzle updates and playing in real time. I'm not sure if that is possible, and I see my carts as useful to people with handhelds and no internet. However, the lichess api idea was a good one and so I'm grateful for his suggestion.

The only problem is that lichess rates it's puzzles by the ratings of people that play. So if a strong player screws up on a puzzle, it's rating goes up... It makes sense but the puzzle strengths don't seem consistent. I called 10 puzzles for each of the five difficulty settings, easiest to hardest. But honestly they all seem too easy. That is the good thing about getting puzzles from books, because those are designed to be tricky and are explicitly puzzles instead of real games.

I finally have move generation and so I think the interface is much more pleasant than any of my previous mate in 2 games. But I still really want some kind of animation when the pieces move.

5
3 comments




Top    Load More Posts ->