Skip to content

Instantly share code, notes, and snippets.

Avatar

Joshua Granick jgranick

View GitHub Profile
@jgranick
jgranick / HelloWorld.hx
Created Oct 14, 2011
Minimal "Hello World" using haxe JS
View HelloWorld.hx
class HelloWorld {
static function main () {
untyped console.log ("Hello haxe JS");
}
}
@jgranick
jgranick / HelloWorld.hx
Created Oct 14, 2011
Another minimal "Hello World" example in haxe JS
View HelloWorld.hx
class HelloWorld {
static function main () {
untyped console.log ("Hello haxe JS");
}
}
View HelloWorld.hx
class HelloWorld {
static function main () {
untyped console.log ("Hello haxe JS");
}
}
@jgranick
jgranick / project.pbxproj
Created Oct 31, 2011
Fixed project template?
View project.pbxproj
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objects = {
/* Begin PBXBuildFile section */
1EEEBA9B121AF1C60048A9DF /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1EEEBA9A121AF1C60048A9DF /* UIKit.framework */; };
@jgranick
jgranick / SDLStage.cpp
Created Oct 31, 2011
Simple GL application
View SDLStage.cpp
#include "SDLStage.h"
SDLStage::SDLStage (int width, int height, int frameRate, int flags) {
if (SDL_Init (SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER) == 0) {
screen = SDL_SetVideoMode (width, height, 0, flags);
if (screen != NULL) {
@jgranick
jgranick / SimpleHX.hx
Created Oct 31, 2011
Now using NME instead
View SimpleHX.hx
import nme.display.Sprite;
class SimpleHX extends Sprite {
public function new () {
super ();
@jgranick
jgranick / DisplayingABitmap.hx
Created Feb 7, 2012
How to display a bitmap (NME recipe)
View DisplayingABitmap.hx
import nme.display.Bitmap;
import nme.display.Sprite;
import nme.Assets;
/**
* @author Joshua Granick
*/
class DisplayingABitmap extends Sprite {
@jgranick
jgranick / PlayingSound.hx
Created Feb 7, 2012
How to play a sound (NME recipe)
View PlayingSound.hx
import nme.display.Sprite;
import nme.media.Sound;
import nme.Assets;
/**
* @author Joshua Granick
*/
class PlayingSound extends Sprite {
@jgranick
jgranick / NyanCat.hx
Created Feb 7, 2012
How to embed SWF content -- Without using <library /> (NME recipe)
View NyanCat.hx
package com.joshuagranick.nyancat;
import format.SWF;
import nme.display.Sprite;
import nme.Assets;
/**
* @author Joshua Granick
@jgranick
jgranick / NyanCat.hx
Created Feb 7, 2012
How to embed SWF content -- Using <library /> (NME recipe)
View NyanCat.hx
package com.joshuagranick.nyancat;
import nme.display.Sprite;
/**
* @author Joshua Granick
*/
class NyanCat extends Sprite {