Created
November 6, 2012 11:06
-
-
Save alamboley/4024051 to your computer and use it in GitHub Desktop.
How to add commands to the console (Citrus Engine recipe)
This file contains hidden or 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
//In the Main class add this command. It will pause and unpause the game : | |
this.console.addCommand("pause", pauseGame); | |
private function pauseGame():void { | |
this.playing = !this.playing; | |
} | |
//Using parameters : | |
this.console.addCommand("goto", goto); | |
private function goto(level:uint):void { | |
trace("you should load level " + level); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment