How jirayutnajan/pixelharvest-progmeth_project works
Main Components
• Application Layer – The entry point is in src/application/Main.java. This launches the game, sets up the environment, and starts the game loop.
• Game Logic – Components in the src/game package (GameController, GameSceneController) manage game state and transitions between scenes.
• Scenes & UI – The src/scenes and src/ui packages include various canvases (GameCanvas, MenuCanvas, TutorialCanvas, etc.) and UI controls such as buttons, dialogs, inventories, and player stats (PlayerHp, PlayerHunger). Also, the src/ui/dialog package holds specialized dialogs.
• Player Management – The src/player package handles the player object and animations.
• World & Map Management – The src/world package is responsible for the game world. Under it, the map subpackage defines different map types (CityMap, FarmMap, HouseMap, etc.), tile layouts, and even in-game elements like different tile types and vegetable objects.
• Utilities – The src/util package contains constants, interfaces (like Drawable, Renderable), which likely support common functions across various modules.
• External Libraries – Make a note of JavaFX (controls, FXML, media) as external dependencies that interface with your UI and media components.
Relationships and Data Flow
• The Application Layer is the bootstrapping point and interacts with the Game Logic to pass control to different Scenes.
• Game Logic coordinates with Scene Controllers, which in turn manage UI components (dialogs, canvas drawing routines) and objects (player, tiles, maps).
• The World/Map module interacts with the Game Logic to generate and update the game’s environment based on CSV map data and tile resources.
• Assets (e.g., CSV tile maps, images, sound files) are loaded by various modules—ensure to represent these as external resources feeding into the application.
• Utility classes support common functionality across all these modules.
Architectural Patterns
• The project is structured in a way that resembles an MVC (Model-View-Controller) or layered architectural design:
– Model: World/Map and Player packages act as data models.
– View: UI and scenes (canvases and dialogs) serve as the visual representation.
– Controller: Game logic components (GameController, GameSceneController) handle user inputs and scene management.
• There’s also a separation between game logic and resource management, showing a clear distinction of concerns.
Relevant Technologies and Frameworks
• Java (and likely Eclipse IDE configuration based on the .project and .settings files)
• JavaFX SDK (for GUI, media control, and possibly FXML support)
• CSV files for tile maps indicate a data-driven approach to scene design.