UNPKG

@rehan-warsi/adventure-game

Version:

Adventure Game is a CLI based project using Typescript

33 lines (24 loc) 508 B
class Characters { name : string health = 100 constructor(name:string){ this.name = name } } export class Player extends Characters { constructor(name:string){ super(name) this.name = name } healthDecrease(){ this.health -= 25 } } export class Opponent extends Characters { constructor(name:string){ super(name) } healthDecrease(){ this.health -= 25 } }