From a6e54811e1dbbf909b33eaa0a40bdb4f3b901471 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sun, 9 Feb 2025 19:13:33 +0000 Subject: Abstractions: use them! --- js/mygame.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/mygame.js b/js/mygame.js index e4453ff..d333345 100644 --- a/js/mygame.js +++ b/js/mygame.js @@ -527,7 +527,7 @@ class MyGame extends Game { this.ctx.drawImage(this.res["wave"], 4, CANVAS_SIZE.h - 8 - 4); /* game over */ - if (this.player.life == 0) { + if (!this.player.is_alive()) { this.ctx.drawImage(this.res["game_over"], CANVAS_SIZE.w / 2 - 36, CANVAS_SIZE.h / 2 - 6); this.ctx.drawImage(this.res["space_restart"], CANVAS_SIZE.w / 2 - 76, CANVAS_SIZE.h / 2 + 4); } -- cgit v1.2.3