# rongxuancheng/game architecture

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

- Interactive diagram: https://gitdiagram.com/rongxuancheng/game
- Repository: https://github.com/rongxuancheng/game

## Overview

The repository is a collection of browser games, described by the README as part of an online-games site; the available evidence does not show a shared launcher or runtime connecting them. The cube game has the clearest documented internal orchestration: Game constructs and coordinates gameplay, presentation, preferences, scores, and persistence. Other games are represented by their major runtime modules, but their internal call paths are mostly unsampled or absent from the index.

Main entry points: [`cube/src/js/Game.js`](https://github.com/rongxuancheng/game/blob/main/cube/src/js/Game.js) (Game coordinator), [`cutfruit/scripts/factory/fruit.js`](https://github.com/rongxuancheng/game/blob/main/cutfruit/scripts/factory/fruit.js) (Fruit behavior), [`cube/src/js/Storage.js`](https://github.com/rongxuancheng/game/blob/main/cube/src/js/Storage.js) (Game persistence), [`cutfruit/scripts/object/lose.js`](https://github.com/rongxuancheng/game/blob/main/cutfruit/scripts/object/lose.js) (Loss display)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g2048["2048"]
  node_app2048["Game application<br/>[application.js]"]
  node_manager2048["Game manager<br/>[game_manager.js]"]
  node_grid2048["Board grid<br/>[grid.js]"]
  node_tile2048["Tiles<br/>[tile.js]"]
  node_input2048["Keyboard input"]
  node_view2048["HTML display<br/>[html_actuator.js]"]
  node_store2048[("Local game storage")]
end

subgraph group_gcube["Cube puzzle"]
  node_gamecube["Game coordinator<br/>[Game.js]"]
  node_cube["Puzzle cube<br/>[Cube.js]"]
  node_controls["Cube controls<br/>[Controls.js]"]
  node_draggable["Drag input<br/>[Draggable.js]"]
  node_scrambler["Scrambler<br/>[Scrambler.js]"]
  node_transition["UI transitions<br/>[Transition.js]"]
  node_tween["Tween engine<br/>[Tween.js]"]
  node_animation["Animation base<br/>[Animation.js]"]
  node_easing["Easing functions<br/>[Easing.js]"]
  node_world["3D world<br/>[World.js]"]
  node_timer["Solve timer<br/>[Timer.js]"]
  node_preferences["Preferences<br/>[Preferences.js]"]
  node_scores["Solve scores<br/>[Scores.js]"]
  node_storage[("Game persistence<br/>[Storage.js]")]
  node_themes["Themes<br/>[Themes.js]"]
  node_themeeditor["Theme editor<br/>[ThemeEditor.js]"]
  node_confetti["Solve effects<br/>[Confetti.js]"]
  node_icons["SVG icons<br/>[Icons.js]"]
end

subgraph group_gfruit["Fruit game"]
  node_fruitmain["Game entry<br/>[main.js]"]
  node_fruit["Fruit behavior<br/>[fruit.js]"]
  node_fruitlayer["Rendering layer<br/>[layer.js]"]
  node_fruittimeline["Animation timeline<br/>[timeline.js]"]
  node_fruittween["Tween functions<br/>[tween.js]"]
  node_fruitmessage["Game messages<br/>[message.js]"]
  node_flame["Fruit effects<br/>[flame.js]"]
  node_lose["Loss display<br/>[lose.js]"]
end

subgraph group_gmario["Mario game"]
end

subgraph group_gdino["Dino game"]
end

node_player(("Player"))

node_player -.->|"plays"| node_app2048
node_player -.->|"plays"| node_gamecube
node_player -.->|"plays"| node_fruitmain
node_gamecube -->|"constructs"| node_world
node_gamecube -->|"constructs"| node_cube
node_gamecube -->|"constructs"| node_controls
node_gamecube -->|"constructs"| node_scrambler
node_gamecube -->|"constructs"| node_transition
node_gamecube -->|"constructs"| node_timer
node_gamecube -->|"constructs"| node_preferences
node_gamecube -->|"constructs"| node_scores
node_gamecube -->|"uses"| node_storage
node_gamecube -->|"constructs"| node_themes
node_gamecube -->|"constructs"| node_themeeditor
node_gamecube -->|"constructs"| node_confetti
node_gamecube -->|"constructs"| node_icons
node_controls -->|"animates with"| node_tween
node_controls -->|"uses input"| node_draggable
node_transition -->|"animates with"| node_tween
node_tween -->|"extends"| node_animation
node_tween -->|"uses"| node_easing
node_storage -->|"loads state"| node_cube
node_storage -->|"restores time"| node_timer
node_storage -->|"loads scores"| node_scores
node_storage -->|"loads preferences"| node_preferences
node_fruit -->|"creates images"| node_fruitlayer
node_fruit -->|"schedules animation"| node_fruittimeline
node_fruit -->|"uses easing"| node_fruittween
node_fruit -->|"posts messages"| node_fruitmessage
node_fruit -->|"creates effect"| node_flame
node_lose -->|"creates images"| node_fruitlayer
node_lose -->|"schedules animation"| node_fruittimeline
node_lose -->|"uses easing"| node_fruittween
node_lose -->|"signals game over"| node_fruitmessage

click node_app2048 "https://github.com/rongxuancheng/game/blob/main/2048/js/application.js"
click node_manager2048 "https://github.com/rongxuancheng/game/blob/main/2048/js/game_manager.js"
click node_grid2048 "https://github.com/rongxuancheng/game/blob/main/2048/js/grid.js"
click node_tile2048 "https://github.com/rongxuancheng/game/blob/main/2048/js/tile.js"
click node_input2048 "https://github.com/rongxuancheng/game/blob/main/2048/js/keyboard_input_manager.js"
click node_view2048 "https://github.com/rongxuancheng/game/blob/main/2048/js/html_actuator.js"
click node_store2048 "https://github.com/rongxuancheng/game/blob/main/2048/js/local_storage_manager.js"
click node_gamecube "https://github.com/rongxuancheng/game/blob/main/cube/src/js/Game.js"
click node_cube "https://github.com/rongxuancheng/game/blob/main/cube/src/js/Cube.js"
click node_controls "https://github.com/rongxuancheng/game/blob/main/cube/src/js/Controls.js"
click node_draggable "https://github.com/rongxuancheng/game/blob/main/cube/src/js/Draggable.js"
click node_scrambler "https://github.com/rongxuancheng/game/blob/main/cube/src/js/Scrambler.js"
click node_transition "https://github.com/rongxuancheng/game/blob/main/cube/src/js/Transition.js"
click node_tween "https://github.com/rongxuancheng/game/blob/main/cube/src/js/Tween.js"
click node_animation "https://github.com/rongxuancheng/game/blob/main/cube/src/js/Animation.js"
click node_easing "https://github.com/rongxuancheng/game/blob/main/cube/src/js/Easing.js"
click node_world "https://github.com/rongxuancheng/game/blob/main/cube/src/js/World.js"
click node_timer "https://github.com/rongxuancheng/game/blob/main/cube/src/js/Timer.js"
click node_preferences "https://github.com/rongxuancheng/game/blob/main/cube/src/js/Preferences.js"
click node_scores "https://github.com/rongxuancheng/game/blob/main/cube/src/js/Scores.js"
click node_storage "https://github.com/rongxuancheng/game/blob/main/cube/src/js/Storage.js"
click node_themes "https://github.com/rongxuancheng/game/blob/main/cube/src/js/Themes.js"
click node_themeeditor "https://github.com/rongxuancheng/game/blob/main/cube/src/js/ThemeEditor.js"
click node_confetti "https://github.com/rongxuancheng/game/blob/main/cube/src/js/Confetti.js"
click node_icons "https://github.com/rongxuancheng/game/blob/main/cube/src/js/Icons.js"
click node_fruitmain "https://github.com/rongxuancheng/game/blob/main/cutfruit/scripts/main.js"
click node_fruit "https://github.com/rongxuancheng/game/blob/main/cutfruit/scripts/factory/fruit.js"
click node_fruitlayer "https://github.com/rongxuancheng/game/blob/main/cutfruit/scripts/layer.js"
click node_fruittimeline "https://github.com/rongxuancheng/game/blob/main/cutfruit/scripts/timeline.js"
click node_fruittween "https://github.com/rongxuancheng/game/blob/main/cutfruit/scripts/lib/tween.js"
click node_fruitmessage "https://github.com/rongxuancheng/game/blob/main/cutfruit/scripts/message.js"
click node_flame "https://github.com/rongxuancheng/game/blob/main/cutfruit/scripts/object/flame.js"
click node_lose "https://github.com/rongxuancheng/game/blob/main/cutfruit/scripts/object/lose.js"

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_app2048,node_manager2048,node_grid2048,node_tile2048,node_input2048,node_view2048,node_store2048 toneBlue
class node_gamecube,node_cube,node_controls,node_draggable,node_scrambler,node_transition,node_tween,node_animation,node_easing,node_world,node_timer,node_preferences,node_scores,node_storage,node_themes,node_themeeditor,node_confetti,node_icons toneAmber
class node_fruitmain,node_fruit,node_fruitlayer,node_fruittimeline,node_fruittween,node_fruitmessage,node_flame,node_lose toneMint
class node_player toneIndigo
```

## Components

### 2048

- [Game application](https://github.com/rongxuancheng/game/blob/main/2048/js/application.js): `2048/js/application.js`
- [Game manager](https://github.com/rongxuancheng/game/blob/main/2048/js/game_manager.js): `2048/js/game_manager.js`
- [Board grid](https://github.com/rongxuancheng/game/blob/main/2048/js/grid.js): `2048/js/grid.js`
- [Tiles](https://github.com/rongxuancheng/game/blob/main/2048/js/tile.js): `2048/js/tile.js`
- [Keyboard input](https://github.com/rongxuancheng/game/blob/main/2048/js/keyboard_input_manager.js): `2048/js/keyboard_input_manager.js`
- [HTML display](https://github.com/rongxuancheng/game/blob/main/2048/js/html_actuator.js): `2048/js/html_actuator.js`
- [Local game storage](https://github.com/rongxuancheng/game/blob/main/2048/js/local_storage_manager.js): `2048/js/local_storage_manager.js`

### Cube puzzle

- [Game coordinator](https://github.com/rongxuancheng/game/blob/main/cube/src/js/Game.js): `cube/src/js/Game.js`
- [Puzzle cube](https://github.com/rongxuancheng/game/blob/main/cube/src/js/Cube.js): `cube/src/js/Cube.js`
- [Cube controls](https://github.com/rongxuancheng/game/blob/main/cube/src/js/Controls.js): `cube/src/js/Controls.js`
- [Drag input](https://github.com/rongxuancheng/game/blob/main/cube/src/js/Draggable.js): `cube/src/js/Draggable.js`
- [Scrambler](https://github.com/rongxuancheng/game/blob/main/cube/src/js/Scrambler.js): `cube/src/js/Scrambler.js`
- [UI transitions](https://github.com/rongxuancheng/game/blob/main/cube/src/js/Transition.js): `cube/src/js/Transition.js`
- [Tween engine](https://github.com/rongxuancheng/game/blob/main/cube/src/js/Tween.js): `cube/src/js/Tween.js`
- [Animation base](https://github.com/rongxuancheng/game/blob/main/cube/src/js/Animation.js): `cube/src/js/Animation.js`
- [Easing functions](https://github.com/rongxuancheng/game/blob/main/cube/src/js/Easing.js): `cube/src/js/Easing.js`
- [3D world](https://github.com/rongxuancheng/game/blob/main/cube/src/js/World.js): `cube/src/js/World.js`
- [Solve timer](https://github.com/rongxuancheng/game/blob/main/cube/src/js/Timer.js): `cube/src/js/Timer.js`
- [Preferences](https://github.com/rongxuancheng/game/blob/main/cube/src/js/Preferences.js): `cube/src/js/Preferences.js`
- [Solve scores](https://github.com/rongxuancheng/game/blob/main/cube/src/js/Scores.js): `cube/src/js/Scores.js`
- [Game persistence](https://github.com/rongxuancheng/game/blob/main/cube/src/js/Storage.js): `cube/src/js/Storage.js`
- [Themes](https://github.com/rongxuancheng/game/blob/main/cube/src/js/Themes.js): `cube/src/js/Themes.js`
- [Theme editor](https://github.com/rongxuancheng/game/blob/main/cube/src/js/ThemeEditor.js): `cube/src/js/ThemeEditor.js`
- [Solve effects](https://github.com/rongxuancheng/game/blob/main/cube/src/js/Confetti.js): `cube/src/js/Confetti.js`
- [SVG icons](https://github.com/rongxuancheng/game/blob/main/cube/src/js/Icons.js): `cube/src/js/Icons.js`

### Fruit game

- [Game entry](https://github.com/rongxuancheng/game/blob/main/cutfruit/scripts/main.js): `cutfruit/scripts/main.js`
- [Fruit behavior](https://github.com/rongxuancheng/game/blob/main/cutfruit/scripts/factory/fruit.js): `cutfruit/scripts/factory/fruit.js`
- [Rendering layer](https://github.com/rongxuancheng/game/blob/main/cutfruit/scripts/layer.js): `cutfruit/scripts/layer.js`
- [Animation timeline](https://github.com/rongxuancheng/game/blob/main/cutfruit/scripts/timeline.js): `cutfruit/scripts/timeline.js`
- [Tween functions](https://github.com/rongxuancheng/game/blob/main/cutfruit/scripts/lib/tween.js): `cutfruit/scripts/lib/tween.js`
- [Game messages](https://github.com/rongxuancheng/game/blob/main/cutfruit/scripts/message.js): `cutfruit/scripts/message.js`
- [Fruit effects](https://github.com/rongxuancheng/game/blob/main/cutfruit/scripts/object/flame.js): `cutfruit/scripts/object/flame.js`
- [Loss display](https://github.com/rongxuancheng/game/blob/main/cutfruit/scripts/object/lose.js): `cutfruit/scripts/object/lose.js`

### Other components

- **Player**

## Connections

- Player → Game application: plays
- Player → Game coordinator: plays
- Player → Game entry: plays
- Game coordinator → 3D world: constructs (evidence: `cube/src/js/Game.js`)
- Game coordinator → Puzzle cube: constructs (evidence: `cube/src/js/Game.js`)
- Game coordinator → Cube controls: constructs (evidence: `cube/src/js/Game.js`)
- Game coordinator → Scrambler: constructs (evidence: `cube/src/js/Game.js`)
- Game coordinator → UI transitions: constructs (evidence: `cube/src/js/Game.js`)
- Game coordinator → Solve timer: constructs (evidence: `cube/src/js/Game.js`)
- Game coordinator → Preferences: constructs (evidence: `cube/src/js/Game.js`)
- Game coordinator → Solve scores: constructs (evidence: `cube/src/js/Game.js`)
- Game coordinator → Game persistence: uses (evidence: `cube/src/js/Game.js`)
- Game coordinator → Themes: constructs (evidence: `cube/src/js/Game.js`)
- Game coordinator → Theme editor: constructs (evidence: `cube/src/js/Game.js`)
- Game coordinator → Solve effects: constructs (evidence: `cube/src/js/Game.js`)
- Game coordinator → SVG icons: constructs (evidence: `cube/src/js/Game.js`)
- Cube controls → Tween engine: animates with (evidence: `cube/src/js/Controls.js`)
- Cube controls → Drag input: uses input (evidence: `cube/src/js/Controls.js`)
- UI transitions → Tween engine: animates with (evidence: `cube/src/js/Transition.js`)
- Tween engine → Animation base: extends (evidence: `cube/src/js/Tween.js`)
- Tween engine → Easing functions: uses (evidence: `cube/src/js/Tween.js`)
- Game persistence → Puzzle cube: loads state (evidence: `cube/src/js/Storage.js`)
- Game persistence → Solve timer: restores time (evidence: `cube/src/js/Storage.js`)
- Game persistence → Solve scores: loads scores (evidence: `cube/src/js/Storage.js`)
- Game persistence → Preferences: loads preferences (evidence: `cube/src/js/Storage.js`)
- Fruit behavior → Rendering layer: creates images (evidence: `cutfruit/scripts/factory/fruit.js`)
- Fruit behavior → Animation timeline: schedules animation (evidence: `cutfruit/scripts/factory/fruit.js`)
- Fruit behavior → Tween functions: uses easing (evidence: `cutfruit/scripts/factory/fruit.js`)
- Fruit behavior → Game messages: posts messages (evidence: `cutfruit/scripts/factory/fruit.js`)
- Fruit behavior → Fruit effects: creates effect (evidence: `cutfruit/scripts/factory/fruit.js`)
- Loss display → Rendering layer: creates images (evidence: `cutfruit/scripts/object/lose.js`)
- Loss display → Animation timeline: schedules animation (evidence: `cutfruit/scripts/object/lose.js`)
- Loss display → Tween functions: uses easing (evidence: `cutfruit/scripts/object/lose.js`)
- Loss display → Game messages: signals game over (evidence: `cutfruit/scripts/object/lose.js`)
