Skip to content

Instantly share code, notes, and snippets.

@bonpixel
Created February 6, 2014 19:03
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 bonpixel/8850519 to your computer and use it in GitHub Desktop.
Save bonpixel/8850519 to your computer and use it in GitHub Desktop.
A Pen by A Non Ymous.
var Character = function() {};
Character.prototype.run = function(callback) {
// do action
callback();
};
var Game = function() {
this.message = "YOU WIN";
this.mainCharacter = new Character();
};
Game.prototype.run = function() {
this.mainCharacter.run(function(message){
console.log(message || this.message);
}.bind(this, 'JK YOU LOOSE'));
}
var game = new Game();
game.run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment