Skip to content

Instantly share code, notes, and snippets.

@jgranick
Created February 8, 2012 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgranick/1771989 to your computer and use it in GitHub Desktop.
Save jgranick/1771989 to your computer and use it in GitHub Desktop.
How to create a simple game loop (NME recipe)
import nme.display.Sprite;
import nme.events.Event;
/**
* @author Joshua Granick
*/
class GameLoop extends Sprite {
public function new () {
super ();
addEventListener (Event.ENTER_FRAME, this_onEnterFrame);
}
private function this_onEnterFrame (event:Event):Void {
// this will fire every frame
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment