Skip to content

Instantly share code, notes, and snippets.

View NovaSquirrel's full-sized avatar

NovaSquirrel

View GitHub Profile
@NovaSquirrel
NovaSquirrel / gist:53006fc5bbbb3c152017d6c64186dae3
Created February 13, 2024 16:11
Animal Crossing Wild World dialog files
2d
2d_menu:
"Grab", "Drop on Ground", "Never Mind", etc.
Stuff you can do from your inventory
stuff related to using items
prompts
Chat messages for when you're sitting on things: I can't move! Outta my way! I can't get down! Phew... Very nice!
Wi-Fi related messages like "There's a visitor"
Days of the week
@NovaSquirrel
NovaSquirrel / TilemapTownBot.py
Created August 25, 2023 21:47
A simple Tilemap Town bot
#!/usr/bin/env python
import asyncio, json, websockets
bot_prefix = "!"
# .----------------------------------------------
# | Command registration
# '----------------------------------------------
protocol_handlers = {}
@NovaSquirrel
NovaSquirrel / tilemaptown retro protocol
Last active March 25, 2023 20:22
Tilemap Town simple binary protocol
------------------- General protocol information -------------------
cc-cc ll-ll [..]
Command, Length, Data
Command types would be represented with a 16-bit enum instead of the four character ASCII codes used here, but those codes could be shown for debug display purposes, or for talking about the protocol.
By default, this protocol can only work with 256 different kinds of tiles at a time. Most platforms this protocol is aimed at probably wouldn't fit more than that into video RAM anyway.
For instance, SNES background layers can only reference 1024 different 8x8 tiles, and 1024/4 = 256 16x16 tiles. Same for the GBA and DS, though the DS could use bitmap modes as a workaround.
@NovaSquirrel
NovaSquirrel / slplatformer.txt
Last active January 11, 2023 19:42
Second Life platformer
/*
Platformer demo thing
Copyright 2023, NovaSquirrel
Copying and distribution of this file, with or without modification, are permitted in any medium without royalty, provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.
*/
// Config
// Amount of ticks (0.05 seconds) to wait before stopping the game due to inactivity. 500 = 25 seconds
@NovaSquirrel
NovaSquirrel / Unique 8x8 tiles.lua
Created October 26, 2022 16:03
Aseprite unique tile counter
-- Unique 8x8 tile counter for Aseprite tilemaps
-- Copyright 2022, NovaSquirel
--
-- Copying and distribution of this file, with or without modification, are permitted in any medium without royalty, provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.
local pc = app.pixelColor
local sprite = app.activeSprite
if not sprite then return app.alert("There is no active sprite") end
local frameNumber = app.activeFrame.frameNumber
@NovaSquirrel
NovaSquirrel / platformer.py
Last active April 10, 2022 18:59
Thumby platformer
import time
import thumby
import math
import random
thumby.display.setFPS(60)
playerSprite = thumby.Sprite(8, 8, bytearray([126,129,173,225,225,173,129,126]), 0, 0, 0)
levelGfx = bytearray([0,0,0,0,0,0,0,0,255,129,141,177,141,177,129,255,0,0,92,244,94,116,0,0,255,153,159,153,153,249,153,255,255,129,133,213,213,157,129,255,255,129,165,153,153,165,129,255,255,129,129,129,129,129,129,255,255,255,102,102,102,102,255,255,32,80,208,80,80,208,80,32,64,160,160,160,160,160,160,64,15,9,9,9,9,9,9,15,240,144,144,144,144,144,144,240,15,11,13,11,13,11,13,15,240,176,208,176,208,176,208,240])
class Tilemap:
@NovaSquirrel
NovaSquirrel / input.c
Last active January 28, 2021 14:33
Petal Crash Online controller handling
// Keep track of instance IDs
struct instance_to_controller {
SDL_JoystickID instance;
SDL_GameController *controller;
struct instance_to_controller *prev, *next;
};
struct instance_to_controller *controllers = NULL;
int game_keys = 0; // Current game actions that keys are pressed for independent of different control methods, like KEY_PUSH_LEFT