Skip to content

Instantly share code, notes, and snippets.

@alamboley
Created November 6, 2012 11:06
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 alamboley/4024051 to your computer and use it in GitHub Desktop.
Save alamboley/4024051 to your computer and use it in GitHub Desktop.
How to add commands to the console (Citrus Engine recipe)
//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