From f8460e9659422df706830fa1e941e49af3633e1f Mon Sep 17 00:00:00 2001 From: Nicky Case Date: Tue, 7 May 2019 15:40:03 -0400 Subject: [PATCH] Fix reset HP bug --- index.html | 4 ++-- scripts/act1/Act1_SceneSetup.js | 3 +++ scripts/game/HP.js | 6 ++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 1d211c4..bb86bf7 100644 --- a/index.html +++ b/index.html @@ -257,7 +257,7 @@ - + @@ -267,7 +267,7 @@ - + diff --git a/scripts/act1/Act1_SceneSetup.js b/scripts/act1/Act1_SceneSetup.js index 7d807b6..2e70000 100644 --- a/scripts/act1/Act1_SceneSetup.js +++ b/scripts/act1/Act1_SceneSetup.js @@ -10,6 +10,9 @@ SceneSetup.act1 = function(){ Game.resetScene(); + // RESET HP + HP.reset(); + // ATTACKS _.attack_harm = 0; _.attack_alone = 0; diff --git a/scripts/game/HP.js b/scripts/game/HP.js index 62e1802..db8c2e6 100644 --- a/scripts/game/HP.js +++ b/scripts/game/HP.js @@ -30,6 +30,8 @@ function HitPoints(){ self.reset = function(){ self.hong = 100; self.beebee = 100; + self.leftWhite = 1; + self.rightWhite = 1; }; self.reset(); @@ -89,12 +91,8 @@ function HitPoints(){ // Draw self.leftShake = 0; self.leftRed = self.leftWhite = 1; - //self.leftWidth = 360; - //self.leftWhiteWidth = 360; self.rightShake = 0; self.rightRed = self.rightWhite = 1; - //self.rightWidth = 360; - //self.rightWhiteWidth = 360; self.drawHalf = function(ctx, isRight){ ctx.save();