fix: 3v3 team match wrong problems
This commit is contained in:
+13
-1
@@ -77,12 +77,24 @@ class Bullet {
|
||||
|
||||
/**
|
||||
* Render the bullet.
|
||||
* In team battle mode, bullet color is determined by the _isAlly flag
|
||||
* set by the scene: ally = bright yellow, enemy = red.
|
||||
* In single-player / PVE mode, owner-based colors are used.
|
||||
* @param {CanvasRenderingContext2D} ctx
|
||||
*/
|
||||
render(ctx) {
|
||||
if (!this.alive) return;
|
||||
|
||||
ctx.fillStyle = this.owner === 'player' ? '#FFFF00' : '#FF6600';
|
||||
let fillColor;
|
||||
if (this._isAlly !== undefined) {
|
||||
// Team mode: use team-aware coloring
|
||||
fillColor = this._isAlly ? '#FFFF00' : '#FF4444';
|
||||
} else {
|
||||
// Single-player / PVE fallback
|
||||
fillColor = this.owner === 'player' ? '#FFFF00' : '#FF6600';
|
||||
}
|
||||
|
||||
ctx.fillStyle = fillColor;
|
||||
ctx.fillRect(
|
||||
this.x - this.halfSize,
|
||||
this.y - this.halfSize,
|
||||
|
||||
Reference in New Issue
Block a user