Game Application Overview
The Tower Defense game is an Angular single-page application (apps/game). It renders a real-time tower-defense match using PixiJS and communicates with the NestJS backend for auth and account management.
Library Dependencies
Three shared libraries power the game:
@tower-defense/game-config(libs/game/config) — static data: tower definitions, enemy archetypes, decks, match constants@tower-defense/game-core(libs/game/core) — deterministic ECS game engine (bitECS), match state, commands@tower-defense/game-pixi(libs/game/pixi) — PixiJS renderer layer, camera controller, per-entity renderers
Key Responsibilities
| Area | What the app does |
|---|---|
| Auth | Session management via Better Auth client, route guarding |
| Profile | Email/name/password changes through the confirmed-change flow |
| Game loop | Drives advanceMatch() on requestAnimationFrame, dispatches player commands |
| Rendering | Feeds MatchSnapshot to SoloPixiRenderer.render() every frame |
| Guest play | /play-solo route is unguarded — no login required |
Documentation Map
| Goal | Page |
|---|---|
| Understand routing, guards and auth pages | Routing and Auth |
| Understand the ECS game engine and match lifecycle | Game Engine |
| Understand HUD panels and the PlaySoloComponent UI | HUD |
| Look up keyboard and mouse controls | Controls |
| Look up key types, commands and config constants | Reference |
| Understand the complete auth + profile change flow | Auth Flow End to End |
Local development
Run pnpm nx run game:serve to start the dev server at http://localhost:4200.