# ibnissah/java-plane-game-main architecture

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

- Interactive diagram: https://gitdiagram.com/ibnissah/java-plane-game-main
- Repository: https://github.com/ibnissah/java-plane-game-main

## Overview

Java Plane Game is a Swing-based 2D shooter. Players use keyboard controls to steer, accelerate, and fire while avoiding enemy rockets and bullets; collisions, health, ammunition, and power-ups govern combat, with effects and sound supporting feedback. The main frame routes users through menu and settings into the game panel, where the game loop coordinates play and rendering. The excerpts establish the UI, controls, and several gameplay interactions; wiring for unsampled object and sound code is shown only where supported by the documented or visible responsibilities.

Main entry points: [`src/game/component/PlaneGame.java`](https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/component/PlaneGame.java) (Game panel), [`src/game/main/Main.java`](https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/main/Main.java) (Main window), [`src/game/component/PanelMenu.java`](https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/component/PanelMenu.java) (Menu panel), [`src/game/obj/Rocket.java`](https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/obj/Rocket.java) (Enemy rockets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Swing interface"]
  node_main["Main window<br/>[Main.java]"]
  node_menu["Menu panel<br/>[PanelMenu.java]"]
  node_settings["Settings panel<br/>[PanelSettings.java]"]
  node_controls["Control bindings<br/>[Controls.java]"]
end

subgraph group_play["Game loop"]
  node_game["Game panel<br/>[PlaneGame.java]"]
  node_key_state["Key state<br/>[KeyPressed.java]"]
end

subgraph group_objects["Gameplay objects"]
  node_player_obj["Player craft<br/>[Player.java]"]
  node_rockets["Enemy rockets<br/>[Rocket.java]"]
  node_rocket_types["Rocket variants"]
  node_bullets["Bullets<br/>[Bullet.java]"]
  node_enemy_bullets["Enemy bullets<br/>[EnemyBullet.java]"]
  node_powerups["Power-ups<br/>[PowerUp.java]"]
  node_health["Health display<br/>[HP.java]"]
  node_hp_render["Health renderer<br/>[HpRender.java]"]
  node_base_object["Object base<br/>[GameObject.java]"]
end

subgraph group_feedback["Game feedback"]
  node_effects["Explosion effects<br/>[Effect.java]"]
  node_boom["Effect particles<br/>[ModelBoom.java]"]
  node_sound["Sound manager<br/>[Sound.java]"]
  node_audio["Sound clips"]
end

node_player(("Player"))
node_swing["Swing display"]

node_player -->|"launches"| node_main
node_main -->|"shows"| node_menu
node_main -->|"shows"| node_settings
node_main -->|"starts"| node_game
node_menu -->|"starts game"| node_main
node_menu -->|"opens settings"| node_main
node_settings -->|"rebinds and saves"| node_controls
node_main -->|"shares"| node_controls
node_game -->|"reads bindings"| node_controls
node_game -->|"updates key state"| node_key_state
node_game -->|"updates and checks"| node_player_obj
node_game -->|"updates and checks"| node_rockets
node_game -->|"updates and checks"| node_bullets
node_game -->|"collects fired bullets"| node_enemy_bullets
node_game -->|"applies pickups"| node_powerups
node_game -->|"creates effects"| node_effects
node_player_obj -->|"creates health display"| node_hp_render
node_rockets -->|"tracks health"| node_hp_render
node_hp_render -->|"uses health state"| node_health
node_rockets -->|"specialized by"| node_rocket_types
node_game -->|"renders game"| node_swing
node_game -.->|"plays effects"| node_sound
node_sound -->|"loads clips"| node_audio
node_effects -->|"creates particles"| node_boom

click node_main "https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/main/Main.java"
click node_menu "https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/component/PanelMenu.java"
click node_settings "https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/component/PanelSettings.java"
click node_controls "https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/component/Controls.java"
click node_game "https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/component/PlaneGame.java"
click node_key_state "https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/component/KeyPressed.java"
click node_player_obj "https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/obj/Player.java"
click node_rockets "https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/obj/Rocket.java"
click node_rocket_types "https://github.com/ibnissah/java-plane-game-main/tree/main/src/game/obj"
click node_bullets "https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/obj/Bullet.java"
click node_enemy_bullets "https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/obj/EnemyBullet.java"
click node_powerups "https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/obj/PowerUp.java"
click node_health "https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/obj/HP.java"
click node_hp_render "https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/obj/HpRender.java"
click node_base_object "https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/obj/GameObject.java"
click node_effects "https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/obj/Effect.java"
click node_boom "https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/obj/ModelBoom.java"
click node_sound "https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/obj/sound/Sound.java"
click node_audio "https://github.com/ibnissah/java-plane-game-main/tree/main/src/game/obj/sound"

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_menu,node_settings,node_controls toneBlue
class node_game,node_key_state toneAmber
class node_player_obj,node_rockets,node_rocket_types,node_bullets,node_enemy_bullets,node_powerups,node_health,node_hp_render,node_base_object toneMint
class node_effects,node_boom,node_sound,node_audio toneRose
class node_player,node_swing toneIndigo
```

## Components

### Swing interface

- [Main window](https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/main/Main.java): `src/game/main/Main.java`
- [Menu panel](https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/component/PanelMenu.java): `src/game/component/PanelMenu.java`
- [Settings panel](https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/component/PanelSettings.java): `src/game/component/PanelSettings.java`
- [Control bindings](https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/component/Controls.java): `src/game/component/Controls.java`

### Game loop

- [Game panel](https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/component/PlaneGame.java): `src/game/component/PlaneGame.java`
- [Key state](https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/component/KeyPressed.java): `src/game/component/KeyPressed.java`

### Gameplay objects

- [Player craft](https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/obj/Player.java): `src/game/obj/Player.java`
- [Enemy rockets](https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/obj/Rocket.java): `src/game/obj/Rocket.java`
- [Rocket variants](https://github.com/ibnissah/java-plane-game-main/tree/main/src/game/obj): `src/game/obj`
- [Bullets](https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/obj/Bullet.java): `src/game/obj/Bullet.java`
- [Enemy bullets](https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/obj/EnemyBullet.java): `src/game/obj/EnemyBullet.java`
- [Power-ups](https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/obj/PowerUp.java): `src/game/obj/PowerUp.java`
- [Health display](https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/obj/HP.java): `src/game/obj/HP.java`
- [Health renderer](https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/obj/HpRender.java): `src/game/obj/HpRender.java`
- [Object base](https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/obj/GameObject.java): `src/game/obj/GameObject.java`

### Game feedback

- [Explosion effects](https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/obj/Effect.java): `src/game/obj/Effect.java`
- [Effect particles](https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/obj/ModelBoom.java): `src/game/obj/ModelBoom.java`
- [Sound manager](https://github.com/ibnissah/java-plane-game-main/blob/main/src/game/obj/sound/Sound.java): `src/game/obj/sound/Sound.java`
- [Sound clips](https://github.com/ibnissah/java-plane-game-main/tree/main/src/game/obj/sound): `src/game/obj/sound`

### Other components

- **Player**
- **Swing display**

## Connections

- Player → Main window: launches
- Main window → Menu panel: shows
- Main window → Settings panel: shows
- Main window → Game panel: starts
- Menu panel → Main window: starts game
- Menu panel → Main window: opens settings
- Settings panel → Control bindings: rebinds and saves
- Main window → Control bindings: shares
- Game panel → Control bindings: reads bindings
- Game panel → Key state: updates key state
- Game panel → Player craft: updates and checks
- Game panel → Enemy rockets: updates and checks
- Game panel → Bullets: updates and checks
- Game panel → Enemy bullets: collects fired bullets
- Game panel → Power-ups: applies pickups
- Game panel → Explosion effects: creates effects
- Player craft → Health renderer: creates health display
- Enemy rockets → Health renderer: tracks health
- Health renderer → Health display: uses health state
- Enemy rockets → Rocket variants: specialized by
- Game panel → Swing display: renders game
- Game panel → Sound manager: plays effects
- Sound manager → Sound clips: loads clips
- Explosion effects → Effect particles: creates particles
