Skip to content

Instantly share code, notes, and snippets.

@aXu-AP
aXu-AP / apworld_builder.py
Created May 15, 2025 19:36
Apworld builder for Archipelago
from fnmatch import fnmatch
import os
from pathlib import Path
import zipfile
def build_apworld(world_name: str, ignore: list[str] = ["*__pycache__/*", "*.gitignore"], directory: str = "worlds"):
world_directory = Path(directory, world_name)
with zipfile.ZipFile(f"output/{world_name}.apworld", "w", zipfile.ZIP_DEFLATED, compresslevel = 9) as zf:
paths = world_directory.rglob("*.*")
for path in paths:
@aXu-AP
aXu-AP / falling_block.gd
Last active October 8, 2023 19:33
Godot falling block game base
# This code can be used freely under CC0 1.0 license.
extends Node2D
## How wide and deep the playing area is.
@export var grid_size := Vector2i(8, 16)
## The visual size of the blocks in pixels.
@export var cell_size := Vector2(32, 32)
## How many blocks / second the current block falls.
@export var block_speed : float = 5.0
## How long the block can be on ground until it sticks.
@aXu-AP
aXu-AP / palette_enforcer.gdshader
Created December 8, 2022 22:35
Godot palette post processing effect
shader_type canvas_item;
render_mode blend_mix;
uniform sampler2D palette;
void fragment()
{
vec3 source_col = texture(TEXTURE, UV).rgb;
vec3 closest_col = vec3(0.0);
float smallest_error = 10.0;