Skip to content

Instantly share code, notes, and snippets.

@jonongjs
jonongjs / Entity.hx
Last active March 28, 2016 18:19 — forked from back2dos/Entity.hx
Macro based entity.
package;
import haxe.macro.Expr;
#if macro
using haxe.macro.Context;
using haxe.macro.Tools;
#end
class Entity {
@jonongjs
jonongjs / FRESteamWorks.hx
Last active March 20, 2016 09:33
Native Steam integration in Haxe, FRESteamWorks-style
package com.amanitadesign.steam;
/*
* Adapted from FRESteamWorks (https://github.com/Ventero/FRESteamWorks).
* TODO: refactor by implementing with @:native instead.
* Original copyright notices below.
*
* Created by Ventero <http://github.com/Ventero>
* Copyright (c) 2012-2013 Level Up Labs, LLC. All rights reserved.
*/
@jonongjs
jonongjs / Main.hx
Last active August 29, 2015 14:26
Getting started with Heaps
class Main extends hxd.App {
var bmp : h2d.Bitmap;
override function init() {
var tile = h2d.Tile.fromColor(0xFF0000, 100, 100);
bmp = new h2d.Bitmap(tile, s2d);
bmp.x = s2d.width * 0.5;
bmp.y = s2d.height * 0.5;
}
@jonongjs
jonongjs / OpenALChannel::release
Last active August 29, 2015 14:21
Hacks to fix OpenFL 1.4.0 audio problems
--- a/project/src/openal/OpenALSound.cpp
+++ b/project/src/openal/OpenALSound.cpp
+ void OpenALChannel::release()
+ {
+ if (mSourceID)
+ alDeleteSources(1, &mSourceID);
+ mSourceID = 0;
+ }
@jonongjs
jonongjs / checkerboard.sh
Created May 15, 2014 01:52
Quick and dirty script to generate a checkerboard transition spritesheet with ImageMagick.
#!/bin/bash
# Quick script to generate a checkerboard transition spritesheet with ImageMagick.
# This script makes PNGs with the names 'tile*.png', 'tmp.png', 'phase1_*.png',
# 'phase2_*.png' and 'checkerboard.png' in the current directory.
SIDE=20 # Width in pixels for each square
MAXN=5 # Number of steps - 1 to fill a square
TILES_ACROSS=16 # Number of squares across the checkerboard
TILES_DOWN=9 # Number of squares down the checkerboard
@jonongjs
jonongjs / PKGBUILD
Created August 27, 2015 04:02
Haxe 3.1.3 PKGBUILD
# Contributor: Dmitry V. Luciv <dluciv@dluciv.name>
# Maintainer: Dmitry V. Luciv <dluciv@dluciv.name>
pkgname=haxe3-bin
pkgver=3.1.3
pkgrel=2
pkgdesc="HaXe (pronounced as hex) is an open source programming language, multiple backends, mostly web-targeted."
url="http://haxe.org/"
license=('GPL')
arch=("i686" "x86_64")