Skip to content

Instantly share code, notes, and snippets.

@ryanflorence
Created May 12, 2010 18:58
Show Gist options
  • Save ryanflorence/398992 to your computer and use it in GitHub Desktop.
Save ryanflorence/398992 to your computer and use it in GitHub Desktop.
var Ninja = new Class({
Extends: Human,
Implements: [Warrior],
initialize: function(side, name, age){
this.side = side;
this.parent(name, age);
}
});
var blackNinja = new Ninja('evil', 'Nin Tendo', 'unknown');
blackNinja.eat(); // inherited from Human
blackNinja.attack(bob); // copied from Warrior
bob.isAlive; // false, bob never had a chance
blackNinja.kills; // 1, from Warrior
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment