Created
June 18, 2018 15:55
-
-
Save Peregg/d84418bf39b0ca493dc93b766934a0a2 to your computer and use it in GitHub Desktop.
Monster
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
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