Created
May 12, 2010 18:58
-
-
Save ryanflorence/398992 to your computer and use it in GitHub Desktop.
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
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