Skip to content

Instantly share code, notes, and snippets.

View wilbefast's full-sized avatar

William Dyce wilbefast

View GitHub Profile
@wilbefast
wilbefast / ExportLocalisation.gs
Last active March 31, 2018 19:00
ExportLocalisation.gs
// This assumes that your sheet looks something like this (in CSV format)
// key, en-gb, en-us, fr-fr
// title, Colour Wars, Color War, Guerres de Coleur
// press_start, Press start, Press start, appuyez sur start
// ... etc
// The script will create a bunch of JSON files at the root of your drive, one for each locale
function exportLocalisation() {
@wilbefast
wilbefast / fitrange_original.py
Last active January 7, 2017 15:27
For Alexia
# VARIABLE LIST
midpoint_part1_TX = 0
midpoint_part1_TZ = 0
midpoint_part2_TX = 0
midpoint_part2_TZ = 0
midpoint_part3_TX = 0
midpoint_part3_TZ = 0
@wilbefast
wilbefast / babysitter.js
Last active December 13, 2015 19:20
Coroutines in Javascript
var babysitter = {
coroutines : []
}
babysitter.add = function(c)
{
// add a new coroutine to be "babysat"
babysitter.coroutines.push(c());
}
@wilbefast
wilbefast / controls.lua
Created September 20, 2015 20:16
A simple little configuration file for keyboard controls.
return {
keyboard = {
{
up = { "w", "z" },
down = { "s" },
left = { "q", "a" },
right = { "d"},
confirm = { "lctrl" },
cancel = { "h" },
advanced = { "lalt" },
@wilbefast
wilbefast / foreground.glsl
Last active August 29, 2015 14:25
A giant messy shader for doing a whole bunch of pixel-effects in Soul Harvest
const vec3 colours[10] = vec3[10](
vec3(217.0 / 255.0, 68.0 / 255.0, 54.0 / 255.0), // team 1 colour
vec3(76.0 / 255.0, 106.0 / 255.0, 255.0 / 255.0), // team 2 colour
vec3(179.0 / 255.0, 98.0 / 255.0, 138.0 / 255.0), // team 3 colour
vec3(65.0 / 255.0, 217.0 / 255.0, 65.0 / 255.0), // team 4 colour
vec3(140.0 / 255.0, 255.0 / 255.0, 64.0 / 255.0), // team 1 glow
vec3(255.0 / 255.0, 163.0 / 255.0, 52.0 / 255.0), // team 2 glow
vec3(255.0 / 255.0, 220.0 / 255.0, 64.0 / 255.0), // team 3 glow
vec3(103.0 / 255.0, 245.0 / 255.0, 255.0 / 255.0), // team 4 glow
vec3(1.0, 1.0, 1.0), // white (pain)
@wilbefast
wilbefast / lava.frag
Created July 14, 2015 08:46
Linear-interpolated colour-cycling
extern number time;
extern mat4 palette;
vec4 effect(vec4 colour, Image texture, vec2 texture_coords, vec2 screen_coords)
{
vec4 base = Texel(texture, texture_coords);
number grey = (base.r + base.g + base.b)/3;
vec4 swapped, next;
@wilbefast
wilbefast / main.lua
Last active August 29, 2015 14:20
ByNumbers example usage
love.load = function()
-- prepare team-colour palettes
bynumbers.addPalette("assets/bynumbers/red.png")
bynumbers.addPalette("assets/bynumbers/blue.png")
bynumbers.addPalette("assets/bynumbers/green.png")
bynumbers.addPalette("assets/bynumbers/yellow.png")
-- create the sprite pack
foregroundb = fudge.new("assets/foreground", {
npot = false,
preprocess_images = { bynumbers.paint }
@wilbefast
wilbefast / fisheye.frag
Created May 1, 2015 18:17
Fish-eye Shader for Love 2D
const float PI = 3.1415926535;
vec4 effect( vec4 color, Image texture, vec2 texture_coords, vec2 screen_coords)
{
float aperture = 178.0;
float apertureHalf = 0.5 * aperture * (PI / 180.0);
float maxFactor = sin(apertureHalf);
vec2 uv;
vec2 xy = 2.0 * texture_coords.xy - 1.0;
@wilbefast
wilbefast / babysitter.lua
Last active August 29, 2015 14:19
Coroutines in Lua
local _coroutines = {}
local _add = function(c)
-- add a new coroutine to be "babysat"
table.insert(_coroutines, c)
end
local _clear = function()
-- remove all the coroutines, start afresh
@wilbefast
wilbefast / soul-harvest_changelog.md
Last active August 29, 2015 14:18
Soul Harvest changelog

v0.4.2 - 10/08/2015

  • bug fixes
    • fixed corpses' alignment with bones
    • killing a technology building during construction no longer "breaks" the player's technology
  • visuals
    • white flash unit damage is done using a shader, so can happen during other animations
    • more team-colour tweaks
    • added "swoosh" attack effects
    • better lavaland tileset
    • better building "bleed" effect