Skip to content

Instantly share code, notes, and snippets.

View anissen's full-sized avatar

Anders Nissen anissen

View GitHub Profile
@anissen
anissen / Main.hx
Created August 19, 2016 13:10 — forked from po8rewq/Main.hx
Empty haxe / pico-8 project
package ;
import Pico.*;
class Main
{
static function main()
{
onInit = init;
@anissen
anissen / Main.hx
Last active July 6, 2016 08:46 — forked from elsassph/ResourceGenerator.hx
Haxe build macro converting a JSON file into strongly typed, inline/dce friendly, properties
class Main {
public static function main() {
trace(R.list);
trace(R.obj.foo);
}
}
@anissen
anissen / GenNew.hx
Last active February 23, 2016 12:14 — forked from ibilon/GenNew.hx
Object construction with macro
import haxe.macro.Expr;
import haxe.macro.Context;
class GenNew {
macro public static function build () : Array<Field> {
var fields = Context.getBuildFields();
var args = [];
var assigns = [];
for (field in fields) {
@anissen
anissen / ThreadPool.hx
Created December 16, 2015 20:27 — forked from hamaluik/ThreadPool.hx
Platform-agnostic thread pool for Haxe / OpenFL
package com.blazingmammothgames.util;
#if neko
import neko.vm.Thread;
import neko.vm.Mutex;
#elseif cpp
import cpp.vm.Thread;
import cpp.vm.Mutex;
#end
@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());
@anissen
anissen / Localization Strings
Last active August 29, 2015 14:05 — forked from steverichey/Localization Strings
Danish translation of "Don't Move"
Here's a list of the strings in the game (SPOILERS kinda):
A game by: Et spil af
Powered by: Kører på
Press left or right to start: Tryk venstre eller højre for at starte
Release left and right: Slip venstre og højre
to start: for at starte
to erase: for at slette
Touch left or right side to start: Tryk venstre eller højre side for at starte
Release both sides: Slip begge sider