# vusivus/street-rally-3d architecture

> Architecture diagram of the GitHub repository vusivus/street-rally-3d, 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/vusivus/street-rally-3d
- Repository: https://github.com/vusivus/street-rally-3d

## Overview

Street Rally 3D is a jMonkeyEngine racing game. Its principal flow is application startup into a car-selection/start screen, then race setup and vehicle control, checkpoint/lap-based race progression, and a results or next-opponent/level screen. The sampled code shows the game-state and race-logic handoff; start-screen actions and some subsystem wiring are only partially visible, so uncertain transitions are omitted.

Main entry points: [`src/sr3d/game/logic/RaceLogic.java`](https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/game/logic/RaceLogic.java) (Race logic), [`src/sr3d/game/types/RaceObjects.java`](https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/game/types/RaceObjects.java) (Race setup and state), [`src/sr3d/controls/vehicle/PlayerNavControl.java`](https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/controls/vehicle/PlayerNavControl.java) (Player vehicle control), [`src/sr3d/controls/vehicle/CheckPointManager.java`](https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/controls/vehicle/CheckPointManager.java) (Checkpoint and lap tracking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application and menus"]
  node_main["Application startup<br/>[Main.java]"]
  node_start["Start and car selection"]
  node_results["Results and progression"]
end

subgraph group_race["Race runtime"]
  node_game["Race setup and state<br/>[RaceObjects.java]"]
  node_logic["Race logic<br/>[RaceLogic.java]"]
  node_factory["Game asset factory<br/>[GameFactory.java]"]
end

subgraph group_driving["Driving and progress"]
  node_playernav["Player vehicle control"]
  node_auto["Opponent driving"]
  node_checkpoints["Checkpoint and lap tracking"]
  node_paths["Track motion paths<br/>[MotionPaths.java]"]
  node_math["Race calculations<br/>[GameMath.java]"]
  node_vehiclevalues["Vehicle control values"]
end

subgraph group_presentation["Race presentation"]
  node_pause["Pause screen<br/>[PauseState.java]"]
end

node_player(("Player"))

node_player -->|"starts game"| node_main
node_main -->|"attaches state"| node_start
node_start -->|"creates game state"| node_game
node_start -->|"builds menu assets"| node_factory
node_game -->|"creates race logic"| node_logic
node_game -->|"creates track paths"| node_paths
node_game -->|"loads race assets"| node_factory
node_logic -->|"reads race state"| node_game
node_logic -->|"attaches trackers"| node_checkpoints
node_logic -->|"uses race route"| node_paths
node_logic -->|"configures driving"| node_playernav
node_logic -->|"configures opponent"| node_auto
node_playernav -->|"tracks vehicle progress"| node_checkpoints
node_auto -->|"tracks vehicle progress"| node_checkpoints
node_playernav -->|"uses control values"| node_vehiclevalues
node_playernav -->|"uses race calculations"| node_math
node_auto -->|"follows route"| node_paths
node_checkpoints -->|"checks waypoints"| node_paths
node_logic -->|"opens results"| node_results
node_results -->|"attaches next race"| node_game
node_logic -.->|"pause behavior"| node_pause

click node_main "https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/Main.java"
click node_start "https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/controls/StartScreenControllerState.java"
click node_results "https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/controls/nextLevelState.java"
click node_game "https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/game/types/RaceObjects.java"
click node_logic "https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/game/logic/RaceLogic.java"
click node_factory "https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/factory/GameFactory.java"
click node_playernav "https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/controls/vehicle/PlayerNavControl.java"
click node_auto "https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/controls/vehicle/AutomaticVehicleControl.java"
click node_checkpoints "https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/controls/vehicle/CheckPointManager.java"
click node_paths "https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/factory/MotionPaths.java"
click node_math "https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/game/logic/GameMath.java"
click node_pause "https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/controls/PauseState.java"
click node_vehiclevalues "https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/controls/vehicle/VehicleControlValues.java"

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_main,node_start,node_results toneBlue
class node_game,node_logic,node_factory toneAmber
class node_playernav,node_auto,node_checkpoints,node_paths,node_math,node_vehiclevalues toneMint
class node_pause toneRose
class node_player toneIndigo
```

## Components

### Application and menus

- [Application startup](https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/Main.java): `src/sr3d/Main.java`
- [Start and car selection](https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/controls/StartScreenControllerState.java): `src/sr3d/controls/StartScreenControllerState.java`
- [Results and progression](https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/controls/nextLevelState.java): `src/sr3d/controls/nextLevelState.java`

### Race runtime

- [Race setup and state](https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/game/types/RaceObjects.java): `src/sr3d/game/types/RaceObjects.java`
- [Race logic](https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/game/logic/RaceLogic.java): `src/sr3d/game/logic/RaceLogic.java`
- [Game asset factory](https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/factory/GameFactory.java): `src/sr3d/factory/GameFactory.java`

### Driving and progress

- [Player vehicle control](https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/controls/vehicle/PlayerNavControl.java): `src/sr3d/controls/vehicle/PlayerNavControl.java`
- [Opponent driving](https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/controls/vehicle/AutomaticVehicleControl.java): `src/sr3d/controls/vehicle/AutomaticVehicleControl.java`
- [Checkpoint and lap tracking](https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/controls/vehicle/CheckPointManager.java): `src/sr3d/controls/vehicle/CheckPointManager.java`
- [Track motion paths](https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/factory/MotionPaths.java): `src/sr3d/factory/MotionPaths.java`
- [Race calculations](https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/game/logic/GameMath.java): `src/sr3d/game/logic/GameMath.java`
- [Vehicle control values](https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/controls/vehicle/VehicleControlValues.java): `src/sr3d/controls/vehicle/VehicleControlValues.java`

### Race presentation

- [Pause screen](https://github.com/vusivus/street-rally-3d/blob/master/src/sr3d/controls/PauseState.java): `src/sr3d/controls/PauseState.java`

### Other components

- **Player**

## Connections

- Player → Application startup: starts game
- Application startup → Start and car selection: attaches state
- Start and car selection → Race setup and state: creates game state
- Start and car selection → Game asset factory: builds menu assets
- Race setup and state → Race logic: creates race logic
- Race setup and state → Track motion paths: creates track paths
- Race setup and state → Game asset factory: loads race assets
- Race logic → Race setup and state: reads race state
- Race logic → Checkpoint and lap tracking: attaches trackers
- Race logic → Track motion paths: uses race route
- Race logic → Player vehicle control: configures driving
- Race logic → Opponent driving: configures opponent
- Player vehicle control → Checkpoint and lap tracking: tracks vehicle progress
- Opponent driving → Checkpoint and lap tracking: tracks vehicle progress
- Player vehicle control → Vehicle control values: uses control values
- Player vehicle control → Race calculations: uses race calculations
- Opponent driving → Track motion paths: follows route
- Checkpoint and lap tracking → Track motion paths: checks waypoints
- Race logic → Results and progression: opens results
- Results and progression → Race setup and state: attaches next race
- Race logic → Pause screen: pause behavior
