feat: add fill for enemy bodies
This commit is contained in:
+2
-2
@@ -86,8 +86,8 @@ const CONFIG = {
|
||||
projectileTrailAlpha: 0.6,
|
||||
projectileCircleAlpha: 0.5,
|
||||
enemyPulseRate: 0.05,
|
||||
enemyAlphaBase: 0.7,
|
||||
enemyAlphaRange: 0.3,
|
||||
enemyAlphaBase: 1.0,
|
||||
enemyAlphaRange: 0.0,
|
||||
enemyGlowPulse: 5,
|
||||
particleDecayBase: 0.02,
|
||||
particleDecayRange: 0.03,
|
||||
|
||||
@@ -151,6 +151,8 @@ class Enemy {
|
||||
ctx.lineTo(this.x - boxW / 2, this.y + boxH / 2 - off);
|
||||
ctx.lineTo(this.x - boxW / 2, this.y - boxH / 2 + off);
|
||||
ctx.closePath();
|
||||
ctx.fillStyle = flash ? "#ffffff" : "#0a0a0a";
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
|
||||
const barW = boxW - S.armorBarPad;
|
||||
@@ -228,6 +230,8 @@ class Enemy {
|
||||
ctx.lineTo(this.x - boxW / 2 + off, this.y + boxH / 2);
|
||||
ctx.lineTo(this.x - boxW / 2, this.y);
|
||||
ctx.closePath();
|
||||
ctx.fillStyle = flash ? "#ffffff" : "#0a0a0a";
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
|
||||
const barW = boxW - S.armorBarPad;
|
||||
@@ -262,6 +266,8 @@ class Enemy {
|
||||
ctx.fillStyle = flash ? CONFIG.colors.white : CONFIG.colors.heavy;
|
||||
ctx.fillText(this.text, this.x, this.y);
|
||||
} else {
|
||||
ctx.fillStyle = flash ? "#ffffff" : "#0a0a0a";
|
||||
ctx.fillRect(this.x - boxW / 2, this.y - boxH / 2, boxW, boxH);
|
||||
ctx.strokeRect(this.x - boxW / 2, this.y - boxH / 2, boxW, boxH);
|
||||
|
||||
ctx.shadowBlur = 0;
|
||||
|
||||
+2
-1
@@ -298,7 +298,8 @@ function draw() {
|
||||
|
||||
for (let p of projectiles) p.draw();
|
||||
for (let p of particles) p.draw();
|
||||
for (let e of enemies) e.draw();
|
||||
const sortedEnemies = enemies.slice().sort((a, b) => a.speed - b.speed);
|
||||
for (let e of sortedEnemies) e.draw();
|
||||
|
||||
if (wavePauseActive) {
|
||||
const alpha = wavePauseTimer > 30 ? 1 : wavePauseTimer / 30;
|
||||
|
||||
Reference in New Issue
Block a user