# skeplys83/superchameleon architecture

> Architecture diagram of the GitHub repository skeplys83/superchameleon, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/skeplys83/superchameleon
- Repository: https://github.com/skeplys83/superchameleon

## Overview

Super Chameleon is a browser-based multiplayer hide-and-seek game backed by one Node/Colyseus server. Players create or join a lobby, the host starts a round on a selected map, and the server runs countdown, hiding, hunt, and reveal phases before returning players to the lobby. The browser presents the 3D world and role-specific controls; the server owns room state and matchmaking. The README documents additional gameplay capabilities, but source excerpts are limited, so uncertain subsystem wiring is omitted.

Main entry points: [`src/client/net/client.ts`](https://github.com/skeplys83/superchameleon/blob/main/src/client/net/client.ts) (Room client), [`src/client/app/Game.tsx`](https://github.com/skeplys83/superchameleon/blob/main/src/client/app/Game.tsx) (Game app), [`src/server/room.ts`](https://github.com/skeplys83/superchameleon/blob/main/src/server/room.ts) (Game room), [`src/client/players/usePointerControls.ts`](https://github.com/skeplys83/superchameleon/blob/main/src/client/players/usePointerControls.ts) (Player controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser game"]
  node_game["Game app<br/>[Game.tsx]"]
  node_scene["3D scene<br/>[Scene.tsx]"]
  node_hud["Game HUD"]
  node_net["Room client<br/>[client.ts]"]
  node_controls["Player controls"]
  node_players["Player actors"]
  node_combat["Combat"]
  node_paint["Player paint"]
  node_world["Maps and world"]
  node_audio["Round audio<br/>[useRoundAudio.ts]"]
  node_sound["Sound engine<br/>[engine.ts]"]
end

subgraph group_server["Game server"]
  node_server["Server entry<br/>[index.ts]"]
  node_sessions["Session listings<br/>[index.ts]"]
  node_rooms["Room registration<br/>[rooms.ts]"]
  node_room["Game room<br/>[room.ts]"]
  node_schema["Room state<br/>[schema.ts]"]
end

subgraph group_shared["Shared contracts"]
  node_protocol["Game protocol<br/>[protocol.ts]"]
  node_maps["Map registry<br/>[maps.ts]"]
end

subgraph group_platform["Platform integration"]
  node_crazy["CrazyGames SDK<br/>[crazygames.ts]"]
end

node_player(("Player"))

node_player -->|"plays"| node_game
node_game -->|"mounts"| node_scene
node_game -->|"presents"| node_hud
node_game -->|"joins rooms"| node_net
node_scene -->|"renders"| node_players
node_scene -->|"loads maps"| node_world
node_controls -->|"resolves shots"| node_combat
node_controls -->|"sends actions"| node_net
node_controls -->|"samples and paints"| node_paint
node_audio -->|"plays round audio"| node_sound
node_net -->|"sends room messages"| node_room
node_room -->|"updates state"| node_schema
node_server -->|"registers rooms"| node_rooms
node_sessions -->|"queries matchmaking"| node_room
node_server -->|"serves listings"| node_sessions
node_room -->|"uses constants"| node_protocol
node_net -->|"uses messages"| node_protocol
node_world -->|"uses map registry"| node_maps
node_crazy -.->|"invites players"| node_net

click node_game "https://github.com/skeplys83/superchameleon/blob/main/src/client/app/Game.tsx"
click node_scene "https://github.com/skeplys83/superchameleon/blob/main/src/client/app/Scene.tsx"
click node_hud "https://github.com/skeplys83/superchameleon/tree/main/src/client/hud"
click node_net "https://github.com/skeplys83/superchameleon/blob/main/src/client/net/client.ts"
click node_controls "https://github.com/skeplys83/superchameleon/blob/main/src/client/players/usePointerControls.ts"
click node_players "https://github.com/skeplys83/superchameleon/tree/main/src/client/players"
click node_combat "https://github.com/skeplys83/superchameleon/tree/main/src/client/combat"
click node_paint "https://github.com/skeplys83/superchameleon/tree/main/src/client/paint"
click node_world "https://github.com/skeplys83/superchameleon/tree/main/src/client/world"
click node_audio "https://github.com/skeplys83/superchameleon/blob/main/src/client/app/session/useRoundAudio.ts"
click node_sound "https://github.com/skeplys83/superchameleon/blob/main/src/client/sound/engine.ts"
click node_server "https://github.com/skeplys83/superchameleon/blob/main/src/server/index.ts"
click node_sessions "https://github.com/skeplys83/superchameleon/blob/main/src/server/index.ts"
click node_rooms "https://github.com/skeplys83/superchameleon/blob/main/src/server/rooms.ts"
click node_room "https://github.com/skeplys83/superchameleon/blob/main/src/server/room.ts"
click node_schema "https://github.com/skeplys83/superchameleon/blob/main/src/server/schema.ts"
click node_protocol "https://github.com/skeplys83/superchameleon/blob/main/src/shared/protocol.ts"
click node_maps "https://github.com/skeplys83/superchameleon/blob/main/src/shared/maps.ts"
click node_crazy "https://github.com/skeplys83/superchameleon/blob/main/src/client/app/crazygames.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_game,node_scene,node_hud,node_net,node_controls,node_players,node_combat,node_paint,node_world,node_audio,node_sound toneBlue
class node_server,node_sessions,node_rooms,node_room,node_schema toneAmber
class node_protocol,node_maps toneMint
class node_crazy toneRose
class node_player toneIndigo
```

## Components

### Browser game

- [Game app](https://github.com/skeplys83/superchameleon/blob/main/src/client/app/Game.tsx): `src/client/app/Game.tsx`
- [3D scene](https://github.com/skeplys83/superchameleon/blob/main/src/client/app/Scene.tsx): `src/client/app/Scene.tsx`
- [Game HUD](https://github.com/skeplys83/superchameleon/tree/main/src/client/hud): `src/client/hud`
- [Room client](https://github.com/skeplys83/superchameleon/blob/main/src/client/net/client.ts): `src/client/net/client.ts`
- [Player controls](https://github.com/skeplys83/superchameleon/blob/main/src/client/players/usePointerControls.ts): `src/client/players/usePointerControls.ts`
- [Player actors](https://github.com/skeplys83/superchameleon/tree/main/src/client/players): `src/client/players`
- [Combat](https://github.com/skeplys83/superchameleon/tree/main/src/client/combat): `src/client/combat`
- [Player paint](https://github.com/skeplys83/superchameleon/tree/main/src/client/paint): `src/client/paint`
- [Maps and world](https://github.com/skeplys83/superchameleon/tree/main/src/client/world): `src/client/world`
- [Round audio](https://github.com/skeplys83/superchameleon/blob/main/src/client/app/session/useRoundAudio.ts): `src/client/app/session/useRoundAudio.ts`
- [Sound engine](https://github.com/skeplys83/superchameleon/blob/main/src/client/sound/engine.ts): `src/client/sound/engine.ts`

### Game server

- [Server entry](https://github.com/skeplys83/superchameleon/blob/main/src/server/index.ts): `src/server/index.ts`
- [Session listings](https://github.com/skeplys83/superchameleon/blob/main/src/server/index.ts): `src/server/index.ts`
- [Room registration](https://github.com/skeplys83/superchameleon/blob/main/src/server/rooms.ts): `src/server/rooms.ts`
- [Game room](https://github.com/skeplys83/superchameleon/blob/main/src/server/room.ts): `src/server/room.ts`
- [Room state](https://github.com/skeplys83/superchameleon/blob/main/src/server/schema.ts): `src/server/schema.ts`

### Shared contracts

- [Game protocol](https://github.com/skeplys83/superchameleon/blob/main/src/shared/protocol.ts): `src/shared/protocol.ts`
- [Map registry](https://github.com/skeplys83/superchameleon/blob/main/src/shared/maps.ts): `src/shared/maps.ts`

### Platform integration

- [CrazyGames SDK](https://github.com/skeplys83/superchameleon/blob/main/src/client/app/crazygames.ts): `src/client/app/crazygames.ts`

### Other components

- **Player**

## Connections

- Player → Game app: plays
- Game app → 3D scene: mounts
- Game app → Game HUD: presents
- Game app → Room client: joins rooms
- 3D scene → Player actors: renders
- 3D scene → Maps and world: loads maps
- Player controls → Combat: resolves shots
- Player controls → Room client: sends actions
- Player controls → Player paint: samples and paints
- Round audio → Sound engine: plays round audio
- Room client → Game room: sends room messages
- Game room → Room state: updates state
- Server entry → Room registration: registers rooms
- Session listings → Game room: queries matchmaking
- Server entry → Session listings: serves listings
- Game room → Game protocol: uses constants
- Room client → Game protocol: uses messages
- Maps and world → Map registry: uses map registry
- CrazyGames SDK → Room client: invites players
