Skip to content

Instantly share code, notes, and snippets.

View anissen's full-sized avatar

Anders Nissen anissen

View GitHub Profile
@Ohmnivore
Ohmnivore / gist:9611540
Created March 18, 2014 00:54
Haxe pixel bender flixel shader
package;
import entities.Player;
import flash.geom.Point;
import flash.geom.Rectangle;
import flixel.addons.plugin.control.FlxControl;
import flixel.addons.plugin.effects.FlxSpecialFX;
import flixel.addons.plugin.effects.fx.StarfieldFX;
import flixel.FlxG;
import flixel.FlxSprite;
@AbelToy
AbelToy / Gradient.hx
Last active August 29, 2015 14:07
Luxe Gradient Component
package;
import luxe.Color;
import luxe.Component;
import luxe.Sprite;
/**
* This will set the color of any Sprite to a gradient.
*
* @author Abel Toy
@anissen
anissen / luxe_resources.md
Last active August 29, 2015 14:07
Luxe resources
@KeyMaster-
KeyMaster- / PlyImporter.hx
Last active August 29, 2015 14:08
Importer for PLY files from Blender into Luxe
package;
import luxe.Mesh;
import haxe.io.StringInput;
import luxe.options.MeshOptions;
import luxe.Vector;
import phoenix.Batcher;
import phoenix.geometry.Geometry;
import PlyParser;
import phoenix.geometry.Vertex;
/**
import snow.platform.native.audio.openal.SoundStream;
import snow.audio.Audio;
import snow.types.Types;
import snow.io.typedarray.Uint8Array;
import snow.io.typedarray.Float32Array;
import snow.Log;
import luxe.Input;
class Main extends luxe.Game {
@jonathanhirz
jonathanhirz / PlayState.hx
Created June 30, 2015 21:11
gesluxe zoom gesture work around
override function onenter<T>( _value:T ) {
earth = new Sprite({
texture : earth_texture,
pos : new Vector(Luxe.screen.w/2, Luxe.screen.h),
});
transformGesture = new TransformGesture();
transformGesture.events.listen(GestureEvent.GESTURE_BEGAN, onTransformGesture);
transformGesture.events.listen(GestureEvent.GESTURE_CHANGED, onTransformGesture);
@francescoagati
francescoagati / Main.hx
Created November 26, 2015 00:41
import yaml in haxe at compile time
#if macro
import yaml.Yaml;
import yaml.Parser;
import yaml.Renderer;
import yaml.util.ObjectMap;
import haxe.macro.Context;
#end
class Main {
@anissen
anissen / Main.hx
Last active November 26, 2015 13:13 — forked from francescoagati/Main.hx
Import JSON in Haxe at compile time
#if macro
import haxe.macro.Context;
#end
class Main {
macro static function load_json(file :String) {
var data = sys.io.File.getContent(file);
var json = haxe.Json.parse(data);
return Context.makeExpr(json, Context.currentPos());
@markknol
markknol / Example.hx
Last active December 25, 2015 06:29
Nape Debug View in Haxe Flambe
//You can use it like this:
System.root.add(new NapeDebugView());
@KeyMaster-
KeyMaster- / PhysBody.hx
Created April 4, 2015 22:16
Luxe rectangles physics engine (WIP, and very basic)
package ;
import luxe.Component;
import luxe.Rectangle;
import luxe.Vector;
class PhysBody {
public var rect:Rectangle;
public var vel:Vector;
public var acc:Vector;