Skip to content

Instantly share code, notes, and snippets.

@will-hart
will-hart / test.rs
Created Sep 25, 2022
My helper for bevy system tests
View test.rs
use std::time::Duration;
use bevy::prelude::*;
use crate::core::time::SpectreTimePlugin;
pub struct TestWorld {
pub app: App,
}
@will-hart
will-hart / pedals.ino
Created Feb 8, 2022
Firmware for custom footpedals using "blue pill" STM32 boards
View pedals.ino
#include <USBComposite.h>
#define LEAN_LEFT_CHAR 'q'
#define LEAN_RIGHT_CHAR 'e'
#define LEAN_LEFT PA9
#define LEAN_RIGHT PA10
#define LED_PIN PC13
USBHID HID;
@will-hart
will-hart / LICENSE
Last active Jul 7, 2021
FFMPEG based video clipper
View LICENSE
Public Domain
@will-hart
will-hart / hexmap.py
Last active Jan 12, 2020
Hexmap generator inkscape extension, without inkscape (and using python 3)
View hexmap.py
#!/usr/bin/env python
# borrowed from https://raw.githubusercontent.com/lifelike/hexmapextension/master/hexmap.py
# which isn't working in inkscape
# import inkex
import sys
# from inkex import NSS
import math
import lxml
@will-hart
will-hart / list_files.py
Last active Oct 30, 2018
Get file information in a directory
View list_files.py
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 30 13:43:22 2018
@author: Will Hart
"""
from datetime import datetime
from os import walk, path
@will-hart
will-hart / SinglePlayerFallback.cs
Created Apr 13, 2017
Single Player Fallback (Forge Networking)
View SinglePlayerFallback.cs
namespace Goliath.Networking
{
#region Dependencies
using BeardedManStudios.Forge.Networking;
using BeardedManStudios.Forge.Networking.Unity;
// other usings
using UnityEngine;
#endregion
@will-hart
will-hart / castle.scad
Last active Feb 5, 2017
A simple castle wall written in OpenSCAD
View castle.scad
// scale the wall up
wall_scale = 10;
// set wall proportions
wall_length = 1;
wall_thickness = 0.3;
wall_height = 0.8;
// crennelation properties
cren_duty_cycle = 0.5;
@will-hart
will-hart / AbstractComponent.cs
Last active Jun 8, 2018
Sentry ECS - a simple public domain entity component system
View AbstractComponent.cs
public abstract class AbstractComponent : IComponent
{
[NonSerialized]
protected Entity _owner;
public AbstractComponent(Entity owner)
{
_owner = owner;
ID = Guid.NewGuid().ToString("n");
}
@will-hart
will-hart / events.cs
Last active Sep 7, 2016
Event driven version
View events.cs
///
/// PlayerManager.cs
///
using System;
public class PlayerManager : MonoBehaviour {
public event EventHandler PlayerDied;
@will-hart
will-hart / README.md
Last active Sep 1, 2021
Stitch together tilemaps into a single image
View README.md

Why?

This is a simple Python / PIL utility for taking a series of images in a tile map set and stitching them together into a single image. This is being used to convert these http://forums.bistudio.com/showthread.php?178671-Tiled-maps-Google-maps-compatible-(WIP) for www.anvilproject.com.

How?

  1. Drop the stitcher.py file into the root directory of your tile map set, where all the numbered folders are
  2. Edit two lines in the file, these are commented - one for the number of folders and one for the number of images in each folder