Skip to content

Instantly share code, notes, and snippets.

View 01010111's full-sized avatar
πŸ‘½
πŸ•Ή

Will Blanton 01010111

πŸ‘½
πŸ•Ή
View GitHub Profile
@Jarrio
Jarrio / CArray.hx
Last active February 7, 2020 13:43
Abstract for array allows for backwards referencing indexes, first/last getters and a built in backwards loop!
package utilities;
@:forward abstract CArray<T>(Array<T>) {
public var last(get, never):T;
public var first(get, never):T;
public function new(value) {
this = value;
}
public function rewind(data:T->Void, end:Int = 0) {
@thejustinwalsh
thejustinwalsh / DebugInfo.hx
Created April 10, 2019 15:22
Heaps Debug Info UI
class DebugInfo extends h2d.Object
{
var sampleRate:Int;
var fpsText:h2d.Text;
var drawCallText:h2d.Text;
public function new(sampleRate:Int, parent:Null<h2d.Object>)
{
super(parent);
this.sampleRate = sampleRate;
@MSGhero
MSGhero / flixel-big-issues.md
Last active October 24, 2020 06:14
A list of issues in Flixel everyone keeps complaining about, so that we actually propose fixes

FlxSpriteGroup

  • FlxSpriteGroup shouldn't exist, but Flixel's "easy to get into" mindset means it has to exist. So now, the class is halfway between AS3 (sprite grouping is the default) and Kha (sprite grouping is DIY)
  • Issues: setting alpha to 0 is unrecoverable. MouseChildren handling subpar, especially compared to flash.display.Sprite#mouseChildren
  • Potential solution: give FlxBasic/Object/Sprites a parent:FlxTypedGroup<> property and propagate that change throughout the lib
  • Impact to lib: major
  • Effort required: possibly a lot
  • Breaking: mouseChildren behavior could be changed to match AS3's

Inheritance

  • Flixel greatly relies on inheritance, which makes it difficult to use
@Eiyeron
Eiyeron / CustomSound.hx
Last active January 12, 2025 04:23
Haxe/Heaps custom Sound/Data class pair to generate sound on the fly. Beware, it's experimental and prone to crash if you tweak the wrong knobs.
import hxd.snd.Data;
import hxd.res.Sound;
// This class should work like a Sound. Jsut create one and call play and a lo-fi generated tune should ring.
// You can check out a bit more about bytebeat there : http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html
class CustomSound extends Sound {
public function new() {
super(null);
data = new SoundDataGenerator();
}
@gepatto
gepatto / 1-Readme.md
Last active January 13, 2021 16:24
Install set versions of haxe, openfl and lime on Raspberry Pi 3 running Stretch

#DEPRECATED, here for historic value

UPDATED to work with Raspbian Stretch

These scripts install a set version of openfl and lime in this case openfl 8.4.0 and Lime 7.0.0 (but you change those) Sometimes the latest version of lime or openfl doesn't work (yet) on the Raspberry Pi.

There's 2 scripts here to install haxe and openfl on Raspberry Pi. One that doesn't ask any questions and just installs everything

@Beeblerox
Beeblerox / CRTFilter
Created July 23, 2017 09:34
CRTFilter for OpenFl 5.0
package;
import openfl.Lib;
import openfl.display.Shader;
import openfl.filters.BitmapFilter;
import openfl._internal.renderer.RenderSession;
import openfl.geom.Point;
/**
* ...
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active May 7, 2025 23:23
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
@glen-cheney
glen-cheney / encoding-video.md
Last active November 24, 2024 10:09
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@jgranick
jgranick / gist:026efc8addaf6cbca353
Created July 29, 2014 05:06
Basic Lime/OpenAL sample
//var bytes = Assets.getBytes ("soundTheme");
//var sound = lime.audio.Sound.loadFromBytes (bytes);
var sound = lime.audio.Sound.loadFromFile ("sounds/theme.ogg");
var format = 0;
if (sound.channels == 1) {
if (sound.bitsPerSample == 8) {