Skip to content

Commit

Permalink
Redraw display even for negative life number
Browse files Browse the repository at this point in the history
  • Loading branch information
dubzzz committed Nov 12, 2015
1 parent d81b4df commit c730b6e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions static/js/WebDisplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ var WebDisplayer = function(screen_canvas, info_canvas) {
};

this.refreshLife = function(remaining_lifes, total_lifes) {
if (total_lifes < 0) {
return;
}
var canvas = info_canvas_.getElementsByClassName("gamerunner-life")[0];
canvas.width = LIFE_SIZE;
canvas.height = LIFE_SIZE;
var ctx = canvas.getContext("2d");
ctx.fillStyle = "#ffffff";
ctx.fillRect(0, 0, LIFE_SIZE, LIFE_SIZE);
if (total_lifes < 0) {
return;
}
ctx.beginPath();
ctx.strokeStyle = "#000000";
ctx.lineWidth = 5;
Expand Down

0 comments on commit c730b6e

Please sign in to comment.