Anonymous Anonymous - 5 months ago
232 0

weird

Javascript

weird javascript

for (const player of this.players) {
            if (player.segments.length === 0) {
                continue;
            }
            // Flash around where you have just spawned
            if (`/#${this.socket.id}` === player.id &&
                    player.moveCounter <= ClientConfig.TURNS_TO_FLASH_AFTER_SPAWN &&
                    player.moveCounter % 2 === 0) {
                this.canvasView.drawSquareAround(player.segments[0], ClientConfig.SPAWN_FLASH_COLOR);
            }

            if (player.base64Image) {
                this.canvasView.drawImages(player.segments, player.base64Image);
            } else {
                this.canvasView.drawSquares(player.segments, player.color);
            }
        }
Comments