//this.ownerStage.mainContext.strokeStyle = "rgba(0, 0, 0, 1)";
//this.ownerStage.mainContext.font = "normal 12px sans-serif";
//drawText(this.ownerStage.mainContext, this.HP, x, y - 20);
- var color = "green";
+
var backColor = "gray";
var thickness = 4;
var barWidth = this.max_HP;
if(barWidth < 16) barWidth = 16;
var barPerHP = this.HP / this.max_HP;
+ var color = "green";
+
+ if(barPerHP < 0.2)
+ {
+ var backColor = "red";
+ }else if(barPerHP < 0.4)
+ {
+ var backColor = "yellow";
+ }
this.ownerStage.mainContext.fillStyle = backColor;
this.ownerStage.mainContext.fillRect(x + (this.size.x - barWidth) / 2, y - thickness, barWidth, thickness);
if(barWidth > this.size.x) barWidth = this.size.x;
var barPerHP = this.HP / this.max_HP;
+ if(barPerHP < 0.2)
+ {
+ var backColor = "red";
+ }else if(barPerHP < 0.4)
+ {
+ var backColor = "yellow";
+ }
+
this.ownerStage.mainContext.fillStyle = backColor;
this.ownerStage.mainContext.fillRect(x + (this.size.x - barWidth) / 2, y - thickness, barWidth, thickness);
this.ownerStage.mainContext.fillStyle = color;