# suhuseoid/game-arcade-bola-tangkas architecture

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

- Interactive diagram: https://gitdiagram.com/suhuseoid/game-arcade-bola-tangkas
- Repository: https://github.com/suhuseoid/game-arcade-bola-tangkas

## Overview

This is a browser-only, offline Bola Tangkas card game. The main workflow is to choose a deck mode and bet, deal and optionally raise, reveal the final cards, evaluate the best five-card hand, then collect winnings or risk them in Double. The UI coordinates the game engine, audio, visual effects, and locally stored credits. The README documents additional presentation and gameplay capabilities; source excerpts do not show all UI handlers or HTML wiring, so uncertain connections are omitted.

Main entry points: [`js/ui.js`](https://github.com/suhuseoid/game-arcade-bola-tangkas/blob/main/js/ui.js) (Game UI), [`js/engine.js`](https://github.com/suhuseoid/game-arcade-bola-tangkas/blob/main/js/engine.js) (Round state), [`index.html`](https://github.com/suhuseoid/game-arcade-bola-tangkas/blob/main/index.html) (Game page), [`js/sound.js`](https://github.com/suhuseoid/game-arcade-bola-tangkas/blob/main/js/sound.js) (Chiptune audio)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Game logic"]
  node_round["Round state<br/>[engine.js]"]
  node_decks["Deck and shuffle<br/>[engine.js]"]
  node_hands["Hand evaluation<br/>[engine.js]"]
  node_double["Double guesses<br/>[engine.js]"]
end

subgraph group_interface["Game interface"]
  node_page["Game page<br/>[index.html]"]
  node_ui["Game UI<br/>[ui.js]"]
end

subgraph group_presentation["Presentation"]
  node_visuals["Visual effects<br/>[effects.js]"]
  node_audio["Chiptune audio<br/>[sound.js]"]
  node_styles["Retro styling<br/>[style.css]"]
end

subgraph group_persistence["Local state"]
  node_credits[("Credit storage<br/>[ui.js]")]
end

node_player(("Player"))
node_browser["Browser audio"]

node_player -->|"opens"| node_page
node_page -.->|"starts"| node_ui
node_player -->|"plays"| node_ui
node_ui -->|"creates game"| node_round
node_ui -->|"deals and raises"| node_round
node_ui -->|"checks hand"| node_hands
node_round -->|"shuffles and draws"| node_decks
node_round -->|"evaluates result"| node_hands
node_ui -->|"submits guess"| node_double
node_ui -->|"saves credits"| node_credits
node_ui -->|"triggers effects"| node_visuals
node_ui -->|"plays cues"| node_audio
node_audio -->|"synthesizes audio"| node_browser
node_page -.->|"uses styling"| node_styles

click node_page "https://github.com/suhuseoid/game-arcade-bola-tangkas/blob/main/index.html"
click node_ui "https://github.com/suhuseoid/game-arcade-bola-tangkas/blob/main/js/ui.js"
click node_round "https://github.com/suhuseoid/game-arcade-bola-tangkas/blob/main/js/engine.js"
click node_decks "https://github.com/suhuseoid/game-arcade-bola-tangkas/blob/main/js/engine.js"
click node_hands "https://github.com/suhuseoid/game-arcade-bola-tangkas/blob/main/js/engine.js"
click node_double "https://github.com/suhuseoid/game-arcade-bola-tangkas/blob/main/js/engine.js"
click node_credits "https://github.com/suhuseoid/game-arcade-bola-tangkas/blob/main/js/ui.js"
click node_visuals "https://github.com/suhuseoid/game-arcade-bola-tangkas/blob/main/js/effects.js"
click node_audio "https://github.com/suhuseoid/game-arcade-bola-tangkas/blob/main/js/sound.js"
click node_styles "https://github.com/suhuseoid/game-arcade-bola-tangkas/blob/main/style.css"

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_round,node_decks,node_hands,node_double,node_browser toneBlue
class node_page,node_ui toneAmber
class node_visuals,node_audio,node_styles toneMint
class node_credits toneRose
class node_player toneIndigo
```

## Components

### Game logic

- [Round state](https://github.com/suhuseoid/game-arcade-bola-tangkas/blob/main/js/engine.js): `js/engine.js`
- [Deck and shuffle](https://github.com/suhuseoid/game-arcade-bola-tangkas/blob/main/js/engine.js): `js/engine.js`
- [Hand evaluation](https://github.com/suhuseoid/game-arcade-bola-tangkas/blob/main/js/engine.js): `js/engine.js`
- [Double guesses](https://github.com/suhuseoid/game-arcade-bola-tangkas/blob/main/js/engine.js): `js/engine.js`

### Game interface

- [Game page](https://github.com/suhuseoid/game-arcade-bola-tangkas/blob/main/index.html): `index.html`
- [Game UI](https://github.com/suhuseoid/game-arcade-bola-tangkas/blob/main/js/ui.js): `js/ui.js`

### Presentation

- [Visual effects](https://github.com/suhuseoid/game-arcade-bola-tangkas/blob/main/js/effects.js): `js/effects.js`
- [Chiptune audio](https://github.com/suhuseoid/game-arcade-bola-tangkas/blob/main/js/sound.js): `js/sound.js`
- [Retro styling](https://github.com/suhuseoid/game-arcade-bola-tangkas/blob/main/style.css): `style.css`

### Local state

- [Credit storage](https://github.com/suhuseoid/game-arcade-bola-tangkas/blob/main/js/ui.js): `js/ui.js`

### Other components

- **Player**
- **Browser audio**

## Connections

- Player → Game page: opens (evidence: `README.md`)
- Game page → Game UI: starts
- Player → Game UI: plays (evidence: `README.md`)
- Game UI → Round state: creates game (evidence: `js/ui.js`)
- Game UI → Round state: deals and raises (evidence: `js/ui.js`)
- Game UI → Hand evaluation: checks hand (evidence: `js/ui.js`)
- Round state → Deck and shuffle: shuffles and draws (evidence: `js/engine.js`)
- Round state → Hand evaluation: evaluates result (evidence: `js/engine.js`)
- Game UI → Double guesses: submits guess (evidence: `js/ui.js`)
- Game UI → Credit storage: saves credits (evidence: `js/ui.js`)
- Game UI → Visual effects: triggers effects (evidence: `js/ui.js`)
- Game UI → Chiptune audio: plays cues (evidence: `js/ui.js`)
- Chiptune audio → Browser audio: synthesizes audio (evidence: `js/sound.js`)
- Game page → Retro styling: uses styling
