Skip to content

feat: team assignment UI in SetupScene - #61

Merged
linkbag merged 2 commits into
mainfrom
feat/ic-team-ui
Mar 9, 2026
Merged

linkbag merged 2 commits into
mainfrom
feat/ic-team-ui

Conversation

@linkbag

@linkbag linkbag commented Mar 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replaces the legacy ALLIANCE PICKER (binary ALLY/ENEMY toggles) with a TEAM ASSIGNMENT panel in SetupScene
  • Each of the 8 player slots (YOU + up to 7 AI) shows color-coded team buttons: [A] [B] [C] [D]
  • Clicking a button assigns that slot to a team; players on the same team become allies in-game

How it works

  • Initializes config.playerTeams from DEFAULT_SLOT_TEAMS = ['A','B','C','D','A','B','C','D']
  • On launch, playerTeams is spread into the SkirmishConfig passed to GameScene
  • GameScene already handles this at line 313: calls deriveAlliancesFromTeams() → setAllianceMode() → win condition uses isEnemy() ✓
  • No GameScene changes needed — the backend was already complete

Default behavior

  • 1–4 players: all on different teams (A/B/C/D) → Free-for-all
  • 5–8 players: teams repeat (5=A, 6=B…) → 2v2, 3v3, or 4v4 by default, adjustable

Team colors

Team Color
A Blue
B Red
C Green
D Yellow

Test plan

  • Open SetupScene — verify TEAM ASSIGNMENT panel appears below AI OPPONENTS stepper
  • Default: slot YOU=A, AI 1=B (shown with blue/red highlights)
  • Click a different team button — verify it highlights and previous deselects
  • Increase AI count — verify new AI slots appear with correct default teams
  • Launch with 2 AI, set YOU+AI 1 = Team A, AI 2 = Team B → YOU and AI 1 should be allies, AI 2 is enemy
  • npx tsc --noEmit → pass
  • npx vitest run → 62/62 pass

🤖 Generated with Claude Code

DZ and others added 2 commits March 9, 2026 13:52
Replace legacy ALLIANCE PICKER with per-slot TEAM ASSIGNMENT panel.
Each of the 8 player slots (YOU + up to 7 AI) shows color-coded [A][B][C][D]
team buttons. Clicking assigns that slot to a team; same-team players
become allies in GameScene via the existing deriveAlliancesFromTeams path.

- Defaults to DEFAULT_SLOT_TEAMS (A/B/C/D/A/B/C/D): FFA for ≤4 players,
  team pairs for 5–8
- config.playerTeams propagated to GameScene via ...this.config spread
- AI count stepper shows/hides inactive slots live
- tsc + vitest: all pass

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@linkbag
linkbag merged commit 7bcb8f9 into main Mar 9, 2026
1 check passed
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.

1 participant