Skip to content

Instantly share code, notes, and snippets.

@Peregg
Created June 18, 2018 15:55
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 Peregg/d84418bf39b0ca493dc93b766934a0a2 to your computer and use it in GitHub Desktop.
Save Peregg/d84418bf39b0ca493dc93b766934a0a2 to your computer and use it in GitHub Desktop.
Monster
class Monster {
constructor (options){
this.name = options;
this.health = 100;
}
heal() {
this.health += 10;
console.log(`${this.name} s'est soigné`)
}
description() {
console.log(`${this.name} a ${this.health} points de vie`)
}
}
class MonsterMini extends monster {
constructor(options){
super(options);
this.health /= 2;
'use strict';
}
heal() {
this.health += 5;
}
}
module.exports = {Monster, MonsterMini};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment