How luke23127006/mario-reflourished works
Main Components
• Core Game Loop & State Management:
• Files: main.cpp, Game.cpp, Shell.cpp, Global.cpp
• Role: Initializes the game, drives the main loop, and manages game states (e.g., Welcome, Pause, Play, VictoryScene).
• Game Modes and Scenes:
• Files: AdventureMode.cpp/h, CustomMode.cpp/h, EndlessMode.cpp/h, VictoryScene.cpp/h, Welcome.cpp/h, Play.cpp/h, Pause.cpp/h
• Role: Different game modes and scenes are almost like state objects that affect gameplay, each representing a unique part of game flow.
• Entities and Components:
• Files: Entity.cpp/h, Component.cpp/h, Enemy.cpp/h (and subclasses such as Goomba, Koopa, Bowser, etc.), Player.cpp/h, EntityFactory.cpp/h, Tile.cpp/h, TileFactory.cpp/h
• Role: These files define individual game objects and the component-based system that may be used for extending behavior. They include players, enemies, and game objects like coins, power-ups, and obstacles.
• Collision and Physics:
• Files: Collision.cpp/h, Barrier.cpp/h, EnemyBarrier.cpp/h, SpikeWall.cpp/h, Lava.cpp/h, Water.cpp/h
• Role: Manage interactions between entities and the environment, ensuring proper collision handling which is vital in a platformer.
• Resource Management:
• Files: Resources.cpp/h, ColorManager.cpp/h, Animation.cpp/h, Particle.cpp/h and the dedicated Resources folder (with textures, maps, characters, audio, and more)
• Role: Handling loading and management of game assets, ensuring that textures, audio, fonts, and other resources are properly accessed.
• User Interface (UI) and Menus:
• Files: HUD.cpp/h, Login.cpp/h, SelectCharacter.cpp/h, SelectLevel.cpp/h, Button.cpp/h, Text.cpp/h
• Role: Responsible for on-screen display elements such as score, menus, and input handling for non-gameplay user interactions.
Component Relationships and Interactions
• The Core Game Loop (main.cpp, Game.cpp) acts as the conductor and interacts with:
• The Game Modes/Scenes to switch between states (Welcome, Play, Pause, Victory, etc.).
• The Entity/Component system, which is updated, rendered, and checks collisions within each frame.
• The Resource Manager to supply textures, audio clips, and other assets.
• The Entity subsystem creates objects using the EntityFactory which instantiates players, enemies, and items (from numerous header and source files).
• SFML integration is central; it handles rendering (Graphics), audio playback (Sound), and input (Window/Events), making these external libraries a critical “service” in the system architecture.
• Collision and physics modules need to interact with entities, ensuring proper overlap testing and responses when entities interact with level geometry or one another.
Architectural Patterns & Design Principles
• Modularity & Separation of Concerns: Each game element (modes, UI, entities) is handled in its own set of files; clearly separating gameplay logic from resource management and presentation.
• Component-Based Design: The existence of a Component.cpp/h suggests that entities might use a component-based system for flexibility.
• Factory Pattern: The EntityFactory and TileFactory signal the use of design patterns to instantiate game objects dynamically.
• Event-driven or State Machine: The differing game modes and UI states imply that the game likely uses state management to transition between game scenes.
Technologies and Frameworks
• SFML is a key technology, as seen in the SFML directory containing headers and libraries for Audio, Graphics, System, etc.
• C++ is the language of choice, with a Visual Studio solution file provided (Mario Reflourished.sln).