Skip to content

Instantly share code, notes, and snippets.

@zzox
zzox / Physics.hx
Created July 28, 2022 02:18
First pass at a physics system
package core;
import core.Types;
typedef DirFlags = {
var left:Bool;
var right:Bool;
var up:Bool;
var down:Bool;
}
@zzox
zzox / DemoSprite.hx
Created June 1, 2021 21:51
Tween between two sets of values in HaxeFlixel without duplicating tweens from repeated calls.
import Snapper;
import flixel.FlxSprite;
// Example Squash-n-Strech
class Player extends FlxSprite {
var stretchDownSnapper:Snapper;
public function new (x:Float, y:Float) {
super(x, y);
@zzox
zzox / midiToJSON.js
Last active December 10, 2023 01:25
Convert midi files outputted by ableton into a json file with time of every note
const { Midi } = require('@tonejs/midi')
const { readFileSync, writeFileSync } = require('fs')
const FILENAME = process.argv[2]
const BPM = process.argv[3]
const DIR_SPECIFIC = process.argv[4] === "true"
const MS_PER_MINUTE = 60000
const ABLETON_PPQ = 96
try {