How tvt0338/btl_group_xg works
Project type and purpose
• This is a standalone desktop game written in Java using JavaFX for its UI. It implements the classic Bomberman gameplay: a menu system, per‐level maps, a real‐time game loop, entity behaviors, collision detection, resource loading, and level progression through Map1 → Map2 → Map3.
File structure
• Top‐level “boomberman/src” subdivides by domain:
• menu/ (MainMenu.java, FXML/CSS, sub‐screens, music, images)
• / (Map1Controller, Map2Controller, Map3Controller + FXML/CSS)
• map1/, map2/, map3/ (level classes + text maps)
• bomberman/ (core: CollisionHandler, Player)
• bomb/ (Bomb.java)
• enemy/ (Enemy base + Balloom, Fly, Oneal, Tanker, Void)
• items/ (Item base + Flame, Speed, Health, God_eye)
• portal/ (Portal.java)
• Configuration/build files are minimal (.gitignore, .iml); no external services (no DB).
Key insights from the README
• MVC-ish separation: UI screens (FXML) handled by Controllers → they instantiate and drive the game engine.
• Real‐time loop: player movement, bomb explosion timer, enemy AI (Random, BFS, A*), collision rules.
• Resource‐based assets: images, CSS, audio loaded at runtime.
Main components & their interactions
a. UI Layer (JavaFX)
– MainMenuController ← user clicks Play/Help/Settings
– MapXController ← drives each level’s UI, HUD, binds to Scene Graph
b. Input Handler
– Listens to keyboard events
– Translates to Player.move() or Player.placeBomb()
c. Game Engine
– GameLoop (timed ticks)
– EntityManager (tracks all Entities: Player, Enemies, Bombs, Items, MapObjects)
– CollisionHandler (resolves overlaps, bomb‐explosion vs. bricks/enemies/player)
– BombManager (schedules explosion, computes “+” area based on Flame upgrades)
– AI subsystem (enemy behaviors via Strategy: Random, BFS, A*)
d. Domain Entities
– Player (hp, speed, inventory of upgrades)
– Enemy subclasses (Balloom, Fly, Oneal, Tanker, Void)
– Bomb (timer, radius)
– Item subclasses (Flame, Speed, Health, God_eye)
– MapObjects (Wall, Brick, Grass, Portal)
e. Loader
– Parses Map_X.txt into in‐memory grid of MapObjects
f. Resource Manager
– Loads images, FXML, CSS, audio files from src/images & src/menu/music
Architectural patterns & principles
• MVC for UI (FXML views + Controllers)
• Game Loop pattern for continuous updates
• Inheritance + Polymorphism for Entities
• Strategy for Enemy pathfinding
• Separation of concerns: Resource loading, Rendering, Input, Game Logic