Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

Enables player spawning from factory entities in addition to default spawn locations.

Changes

  • Factory spawn integration: Added factorySpawn chance mechanism (5% probability) when factories exist on the map
  • Random positioning utility: Extracted getRandomPosition() to shared util for reuse across spawn systems
  • Team assignment fixes: Corrected base locations for 4-team mode and maze wall team handling
  • Admin controls: Added broadcast message function and fun command for testing
  • Stability improvements: Fixed crashes related to entity cleanup, color updates, and null safety checks
  • Performance: Optimized AI tick rate

Implementation

Players now have a chance to spawn from an existing factory entity:

// On spawn, check for factory spawn possibility
if (Math.random() < 0.05 && factoriesExist) {
  spawnFromRandomFactory();
} else {
  spawnAtDefaultLocation();
}

The spawn location selection uses the new shared getRandomPosition() utility that ensures valid positioning within arena bounds.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add player spawning from factories Players can now spawn from factories Jan 16, 2026
Copilot AI requested a review from abcxff January 16, 2026 15:58
@abcxff abcxff closed this Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants