How nano-a/towerdefense works
Project type and purpose
• Tower Defense is a standalone desktop game written in Java using Swing (UI) and Jackson (JSON parsing).
• It follows a modular, package-based architecture dividing responsibilities: UI, game state management, mechanics, utilities, resource loading, and input/event handling.
File structure
• Top-level organization:
• src/ – Java packages
– utilisateurinterface & compInterface: Swing UI classes and custom controls
– gestionnaire: core game loop, state machine (Deroulement, Etat, Evolueur)
– composants: domain model (Tour, Adversaire, ChampBataille, Munition)
– mecaniques, mouvement, cartographie, categories: pathfinding (A*), movement math, level maps, enums/types
– outils: resource loading (LecteurDeFichier, ChargImage), logging (Journalisateur), constants
– surveillant: global input hooks via JNativeHook (Gardien, Surveille)
– reglage: parameter management
• res/ – static resources (images, level JSON/CSV, external JARs)
• bin/ – compiled output and mirrored resource structure
README for technical insights
• MVC-style separation: UI packages vs. logic packages
• Uses multithreading for smooth updates
• Levels defined in JSON/CSV, parsed by Jackson libraries
• Entry point: utilisateurinterface.CadreJeu
Final advice
• Don’t omit cross-cutting services like logging and configuration.
• Explicitly show the entry point (utilisateurinterface.CadreJeu) and its initialization flow.