Skip to content

Instantly share code, notes, and snippets.

View jgranick's full-sized avatar

Joshua Granick jgranick

View GitHub Profile
@jgranick
jgranick / install-haxe.sh
Last active September 3, 2023 15:47
Haxe Linux install script
#!/bin/sh
HAXE_VERSION=3.2.1
NEKO_VERSION=2.0.0
if [ `uname -m` = "armv7l" ]; then
HAXE_VERSION=3.1.3
@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) {
@jgranick
jgranick / gist:9369381
Created March 5, 2014 15:24
Basic IAP Example
package;
import extension.iap.IAP;
import extension.iap.IAPEvent;
import flash.display.Sprite;
class Main extends Sprite {
@jgranick
jgranick / Main.hx
Created March 5, 2014 15:07
Basic GameCenter Example
package;
import extension.gamecenter.GameCenter;
import extension.gamecenter.GameCenterEvent;
import flash.display.Sprite;
class Main extends Sprite {
@jgranick
jgranick / CustomAssetLibrary.hx
Created September 27, 2013 16:51
Adding a Custom Asset Library
package;
import flash.utils.ByteArray;
import openfl.Assets;
class CustomAssetLibrary extends AssetLibrary {
@jgranick
jgranick / Main.hx
Last active December 19, 2015 03:09
Adding controller support for OUYA
package;
import flash.display.Sprite;
import flash.geom.Point;
import openfl.events.JoystickEvent;
#if android
import openfl.utils.JNI;
import tv.ouya.console.api.OuyaController;
@jgranick
jgranick / Main.hx
Created June 4, 2013 21:04
Simple example
import flash.display.Sprite;
class Main extends Sprite {
public function new () {
super ();
@jgranick
jgranick / install.sh
Last active December 17, 2015 19:09
DO NOT DO THIS ANYMORE. The following script installs a 32-bit version of Neko, instead of the 64-bit version that comes with the Haxe 3 install. Your Neko install should match your OS X install, which means unless you are running an OLD system, you want the 64-bit version. OpenFL does properly support 64-bit Neko, and expects this on 64-bit sys…
#!/bin/sh
# Download Neko
curl -L http://nekovm.org/_media/neko-2.0.0-osx.tar.gz > neko-2.0.0-osx.tar.gz
# Extract and copy files to /usr/lib/neko
@jgranick
jgranick / .htaccess
Last active June 3, 2019 14:19
SimpleGL
SetOutputFilter DEFLATE
emcc hello.cpp -o bin/hello.js