Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Add Comment
Please, Sign In to add comment