class Life extends Sprite {
    constructor(x, y, maxLives = 3, game) {
        super(x, y, 0, 0);
        this.lives = maxLives;
        this.isUI = true; 
        this.game = game;
    }

    update() { return false; }

    draw(ctx) {
        ctx.fillStyle = 'black';
        ctx.font = '20px Arial';
        ctx.fillText(`Lives: ${this.lives}`, this.x, this.y);
    }

    lose() {
        this.lives--;
        if (this.lives <= 0 ){
           this.game.changeLevel(3);
        }
    }
}
