Created
February 8, 2012 18:33
-
-
Save jgranick/1771989 to your computer and use it in GitHub Desktop.
How to create a simple game loop (NME recipe)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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