How taetep01/cpfreezetag works
CP Freezetag is a browser-based multiplayer freeze-tag game. Players enter through the menu, host a room or join by code, wait in a lobby, then play a real-time round with chaser/runner roles, freezing, items, and win conditions. The Phaser client communicates with a Colyseus server; the server owns room state and game rules. The excerpts show key message handlers and client state listeners, but not every rule or scene interaction, so unverified protocol links are dashed.
Main entry points: GameRoom.ts Game room · HostJoinScene.ts Host or join · LobbyScene.ts Room lobby · main.ts Phaser entry
Components 16
Client flow
- Main menu
client/src/scenes/MainMenuScene.ts - Host or join
client/src/scenes/HostJoinScene.ts - Room lobby
client/src/scenes/LobbyScene.ts - Game scene
client/src/scenes/GameScene.ts
Client runtime
- Phaser entry
client/src/main.ts - Room client
client/src/network/GameClient.ts - Game version
client/src/version.ts
Server runtime
- Colyseus server
server/src/index.ts - Game room
server/src/rooms/GameRoom.ts
Game rules
- Player and item state
server/src/rooms/GameRoom.ts - Round setup
server/src/rooms/GameRoom.ts - Movement and tagging
server/src/rooms/GameRoom.ts - Item effects
server/src/rooms/GameRoom.ts - Round timer
server/src/rooms/GameRoom.ts - Win and end rules
server/src/rooms/GameRoom.ts
Other components
- Player
Connections 28
- Player → Main menu: opens
client/src/scenes/MainMenuScene.ts - Main menu → Host or join: opens
client/src/scenes/MainMenuScene.ts - Phaser entry → Main menu: registers
client/src/main.ts - Phaser entry → Host or join: registers
client/src/main.ts - Phaser entry → Room lobby: registers
client/src/main.ts - Phaser entry → Game scene: registers
client/src/main.ts - Host or join → Room client: creates or joins
client/src/scenes/HostJoinScene.ts - Host or join → Room lobby: opens after connection
client/src/scenes/HostJoinScene.ts - Room lobby → Room client: requests start
client/src/scenes/LobbyScene.ts - Room lobby → Game scene: opens on start
client/src/scenes/LobbyScene.ts - Game scene → Room client: sends gameplay actions
client/src/scenes/GameScene.ts - Host or join → Game version: displays
client/src/scenes/HostJoinScene.ts - Room lobby → Game version: displays
client/src/scenes/LobbyScene.ts - Main menu → Game version: displays
client/src/scenes/MainMenuScene.ts - Room client → Colyseus server: connects to
- Colyseus server → Game room: registers room
server/src/index.ts - Game room → Player and item state: initializes
server/src/rooms/GameRoom.ts - Game room → Round setup: handles start
server/src/rooms/GameRoom.ts - Game room → Movement and tagging: handles movement
server/src/rooms/GameRoom.ts - Game room → Item effects: handles item actions
server/src/rooms/GameRoom.ts - Round setup → Player and item state: assigns roles
server/src/rooms/GameRoom.ts - Movement and tagging → Player and item state: updates players
server/src/rooms/GameRoom.ts - Movement and tagging → Win and end rules: can end round
server/src/rooms/GameRoom.ts - Item effects → Player and item state: updates items and players
server/src/rooms/GameRoom.ts - Game room → Round timer: starts timer
server/src/rooms/GameRoom.ts - Round timer → Win and end rules: ends on timeout
server/src/rooms/GameRoom.ts - Game room → Win and end rules: handles departures
server/src/rooms/GameRoom.ts - Player and item state → Game scene: syncs state