Skip to main content

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

AreaWhat the app does
AuthSession management via Better Auth client, route guarding
ProfileEmail/name/password changes through the confirmed-change flow
Game loopDrives advanceMatch() on requestAnimationFrame, dispatches player commands
RenderingFeeds MatchSnapshot to SoloPixiRenderer.render() every frame
Guest play/play-solo route is unguarded — no login required

Documentation Map

GoalPage
Understand routing, guards and auth pagesRouting and Auth
Understand the ECS game engine and match lifecycleGame Engine
Understand HUD panels and the PlaySoloComponent UIHUD
Look up keyboard and mouse controlsControls
Look up key types, commands and config constantsReference
Understand the complete auth + profile change flowAuth Flow End to End
Local development

Run pnpm nx run game:serve to start the dev server at http://localhost:4200.