Skip to content

Instantly share code, notes, and snippets.

View jessevanherk's full-sized avatar

Jesse van Herk jessevanherk

View GitHub Profile
shader_type canvas_item;
// this is a simple godot shader to clip (or crop or mask) a sprite to a smaller area
// pass in 4 values representing the left, right, top, bottom extents to clip to.
// they should be values between 0 and 1 because we're working with an UV texture.
uniform float left_clip = 0.0;
uniform float right_clip = 1.0;
uniform float top_clip = 0.0;
uniform float bottom_clip = 1.0;
@jessevanherk
jessevanherk / Makefile
Last active October 25, 2018 03:23
A sample makefile and support files to build a love2d game for multiple platforms from linux
LOVE_BIN=/usr/bin/love
LOVE_DIR=./src/love
DIST_DIR=./src/dist
PATCH_DIR=./src/patch
BUILD_DIR=./build
BIN_DIR=./bin
LOVE_VERSION=0.9.1
GAME_NAME=MySampleGame
PRETTY_NAME=My Sample Game
@jessevanherk
jessevanherk / comparenoise.c
Created December 9, 2015 01:16
direct implementation of simplex and perlin noise in C, no optimizations, allowing for speed comparison.
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int grad3[12][3] = {{1,1,0},{-1,1,0},{1,-1,0},{-1,-1,0},
{1,0,1},{-1,0,1},{1,0,-1},{-1,0,-1},
{0,1,1},{0,-1,1},{0,1,-1},{0,-1,-1}};
int p[] = {151,160,137,91,90,15,
131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,
@jessevanherk
jessevanherk / ProFi.lua
Created October 20, 2015 22:51 — forked from perky/ProFi.lua
ProFi, a simple lua profiler that works with LuaJIT and prints a pretty report file in columns.
--[[
ProFi v1.3, by Luke Perkin 2012. MIT Licence http://www.opensource.org/licenses/mit-license.php.
Example:
ProFi = require 'ProFi'
ProFi:start()
some_function()
another_function()
coroutine.resume( some_coroutine )
ProFi:stop()
@jessevanherk
jessevanherk / painting2sprites.sh
Created July 22, 2014 05:12
script to convert an ORA file from Krita to PNGs
#!/bin/bash
# painting2sprites - A simple script to read an ORA, resize and trim output PNGs.
INPUT_FILE=$1
OUTPUT_DIR=$2
RESIZE_SCALE="25%"
if [ "$2" == "" ]; then
#!/bin/bash
# flattenpsd - A simple script to read a PSD and save each layer as a PNG.
#
INPUT_FILE=$1
OUTPUT_DIR=$2
if [ "$2" == "" ]; then
echo "Usage: $0 <input_psd> <output_dir>"