foam gun, mods: overcharge, supersaturate, many background adjustments
This commit is contained in:
19
js/mobs.js
19
js/mobs.js
@@ -29,6 +29,20 @@ const mobs = {
|
||||
ctx.stroke();
|
||||
}
|
||||
},
|
||||
healthBar() {
|
||||
for (let i = 0, len = mob.length; i < len; i++) {
|
||||
if (mob[i].seePlayer.recall && mob[i].showHealthBar) {
|
||||
const h = mob[i].radius * 0.3;
|
||||
const w = mob[i].radius * 2;
|
||||
const x = mob[i].position.x - w / 2;
|
||||
const y = mob[i].position.y - w * 0.7;
|
||||
ctx.fillStyle = "rgba(100, 100, 100, 0.3)";
|
||||
ctx.fillRect(x, y, w, h);
|
||||
ctx.fillStyle = "rgba(255,0,0,0.7)";
|
||||
ctx.fillRect(x, y, w * mob[i].health, h);
|
||||
}
|
||||
}
|
||||
},
|
||||
// alert(range) {
|
||||
// range = range * range;
|
||||
// for (let i = 0; i < mob.length; i++) {
|
||||
@@ -64,6 +78,7 @@ const mobs = {
|
||||
alive: true,
|
||||
index: i,
|
||||
health: 1,
|
||||
showHealthBar: true,
|
||||
accelMag: 0.001,
|
||||
cd: 0, //game cycle when cooldown will be over
|
||||
delay: 60, //static: time between cooldowns
|
||||
@@ -914,10 +929,8 @@ const mobs = {
|
||||
}
|
||||
}
|
||||
},
|
||||
healthBar() {
|
||||
//draw health bar
|
||||
healthBar() { //draw health by mob //most health bars are drawn in mobs.healthbar();
|
||||
if (this.seePlayer.recall) {
|
||||
// && this.health < 1
|
||||
const h = this.radius * 0.3;
|
||||
const w = this.radius * 2;
|
||||
const x = this.position.x - w / 2;
|
||||
|
||||
Reference in New Issue
Block a user