How claudianistal/return-to-the-jungle works
Project Type and Purpose
• This is a 2D platformer video game built in C++ for an academic project.
• The game uses SDL2 as its graphics, input, and audio library and includes external libraries (e.g., Chipmunk, for physics) bundled in the docs/librerias directory.
• The gameplay revolves around distinct animal characters (Mono, Elefante, Serpiente, Tucán, Capibara) navigating obstacles in city and jungle environments.
Main Components
A. Game Initialization & Main Loop
• Main.cpp and Game.cpp are the entry points.
B. Game Layers and Scenes
• Different layers in the game such as:
– MenuLayer (for main menu interactions)
– CharacterSelectionLayer (for picking characters)
– GameLayer (for in-game play)
– MenuFinalLayer (for end-of-game or win/lose screens)
• These should be visualized as separate, interacting modules within the overall game engine.
C. Entities and Actors
• Actors include classes such as Actor, Enemy, Player, and various specialized entities (e.g., Capibara, Mono, Elefante, Serpiente, Tucan).
• Animation (Animation.cpp/.h) to handle sprite animations, and Audio for sound effects/music.
• Use “Entity Manager” or “Game Objects” module to denote the management of these actors.
D. Tile and Level Design System
• A set of classes such as Tile, BoxTile, WaterTile, TunnelTile, etc., build the 2D tile environment for the levels.
• That levels are defined by text files inside the ‘res’ directory – creating a map parser/level loader component.
E. External Libraries and Resource Management
• SDL2 is the core library for handling graphics, input, and audio.
• Chipmunk (from the docs/librerias/include/chipmunk folder) is likely used for physics/collision handling.
• An “External Dependencies” module that interacts with both the game engine and subsystems like rendering and physics.
• A “Resource Manager” component should also be noted as responsible for loading assets (sprites, audio, level layouts) from the ‘res’ folder.
Relationships & Interactions
• Associations between the Game Engine and the Entities sub-system (for updating positions, handling animations and audio).
• Data flow from the Resource Manager to the Entities (for assets) and Level Loader.
• Dependencies where the SDL2 and Chipmunk libraries provide lower-level services (graphics rendering, event handling, physics simulation).
Architectural Patterns & Principles
• Modular design by isolating layers and components; this separation aids maintenance and potential future expansion.