Skip to content

Instantly share code, notes, and snippets.

Avatar

Joshua Granick jgranick

View GitHub Profile
@jgranick
jgranick / install-haxe.sh
Last active Feb 11, 2021
Haxe Linux install script
View install-haxe.sh
#!/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 Jul 29, 2014
Basic Lime/OpenAL sample
View gist:026efc8addaf6cbca353
//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 Mar 5, 2014
Basic IAP Example
View gist:9369381
package;
import extension.iap.IAP;
import extension.iap.IAPEvent;
import flash.display.Sprite;
class Main extends Sprite {
@jgranick
jgranick / Main.hx
Created Mar 5, 2014
Basic GameCenter Example
View Main.hx
package;
import extension.gamecenter.GameCenter;
import extension.gamecenter.GameCenterEvent;
import flash.display.Sprite;
class Main extends Sprite {
@jgranick
jgranick / CustomAssetLibrary.hx
Created Sep 27, 2013
Adding a Custom Asset Library
View CustomAssetLibrary.hx
package;
import flash.utils.ByteArray;
import openfl.Assets;
class CustomAssetLibrary extends AssetLibrary {
@jgranick
jgranick / Main.hx
Last active Dec 19, 2015
Adding controller support for OUYA
View Main.hx
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 Jun 4, 2013
Simple example
View Main.hx
import flash.display.Sprite;
class Main extends Sprite {
public function new () {
super ();
@jgranick
jgranick / install.sh
Last active Dec 17, 2015
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…
View install.sh
#!/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
View .htaccess
SetOutputFilter DEFLATE
View build.bat
emcc hello.cpp -o bin/hello.js