Lutemon is a monster battling and training game where players can create, train, and battle with creatures called Lutemons. The game is built using the LibGDX framework, which provides cross-platform compatibility for Android and desktop environments. The project follows a clean architecture with clear separation of concerns between the model, view, and controller components.
The game includes several key features that enhance the gameplay experience:
- Create Lutemons: Players can create Lutemons of different types (White, Green, Pink, Orange, Black) with unique base stats.
- Train Lutemons: Train Lutemons to gain experience and improve their stats.
- Heal Lutemons: Heal all Lutemons at home to restore their health.
- Move Lutemons: Move Lutemons between locations (Home, Training, Battle).
- Turn-Based Battles: Engage in battles where players can attack, defend, or use special moves.
- AI Opponent: Battles include an AI-controlled enemy Lutemon with randomized actions.
- Battle Stats: Track wins, losses, and battles fought for each Lutemon.
- Special Attacks: Perform high-damage special attacks with a chance of missing.
- Animated Avatars: Lutemons have animated avatars for idle, attack, defend, run, hurt and die states.
- Battle Animations: Smooth animations for attacks, movements, and health changes.
- Experience Gain: Training increases Lutemon experience and improves stats.
- Training Days: Track the number of days a Lutemon has been trained.
- Game Statistics: Displays detailed stats for each Lutemon.
- Home Screen: Displays all Lutemons at home with their stats and animations.
- Training Screen: Allows players to select Lutemons for training.
- Battle Arena: A dynamic UI for battles, showing health bars, animations, and actions.
- Save and Load: Save the game state to a file and load it later.
- Auto-Save: Automatically saves the game progress at key points.
- Dynamic Scaling: UI elements scale based on screen size for consistent appearance.
- Theming: Skins and fonts are customizable through asset files.
The game is designed using object-oriented principles, with a focus on SOLID principles, encapsulation, inheritance, and polymorphism. Key classes include:
- Lutemon: Base class for all Lutemons, containing properties like health, attack, and defense.
- BattleLutemon: Inherits from Lutemon and adds battle-specific properties and methods.
- TrainingLutemon: Inherits from Lutemon and adds training-specific properties and methods.
- AnimationManager: Manages all animations for Lutemons, including loading and playing animations.
- AssetLoader: Loads and manages game assets, including textures, fonts, and UI skins.
- SaveManager: Handles saving and loading game state to and from JSON files.
- ProfileManager: Manages multiple player profiles and their associated game states.
- StatisticsManager: Tracks game statistics and metrics.
- UI Components: Custom UI components for displaying health bars, dialogs, and animated avatars.
- Screen Management: Each game screen is implemented as a separate class, allowing for modular and maintainable code.
- Constants: Centralized class for game parameters, making it easier to manage and adjust settings.
Each Lutemon type has unique base stats:
- White Lutemon: High defense, low attack (Attack: 5, Defense: 4, Health: 20)
- Green Lutemon: High defense, low attack (Attack: 6, Defense: 3, Health: 19)
- Pink Lutemon: Balanced stats (Attack: 7, Defense: 2, Health: 18)
- Orange Lutemon: High attack, low health (Attack: 8, Defense: 1, Health: 17)
- Black Lutemon: High attack, no defense (Attack: 9, Defense: 0, Health: 16)
The battle system is one of the most complex parts of the game:
- Battles occur between two Lutemons in a dedicated battle arena
- Players can control their Lutemon with keyboard/touch inputs
- The
BattleLutemonclass extends the base Lutemon with battle-specific properties - Battles include real-time movement, jumping, and attacking
- The damage system considers attack values, defense stats, and includes randomness for variety
- Animations synchronize with attack timing for visual feedback
During battles, Lutemons can perform several actions:
- Basic attacks that deal damage based on attack stats
- Defensive moves that temporarily increase defense
- Special attacks with higher damage but lower accuracy
- Movement to position strategically in the battle arena
The battle ends when one Lutemon's health reaches zero, and the winner gains experience points.
The training system allows players to improve their Lutemons:
- Lutemons can be sent to the training area
- Training increases experience points and training days
- Experience points automatically improve a Lutemon's stats
- The
TrainingScreenprovides visual feedback during training - Training animations show Lutemons performing exercises
- Max Health:
- For every 5 experience points, max health increases by 1
- Implemented in
getEffectiveMaxHealth()
- Attack:
- For every 10 experience points, attack increases by 1
- Implemented in
getEffectiveAttack()
- Defense:
- For every 15 experience points, defense increases by 1
- Implemented in
getEffectiveDefense()
The game features a sophisticated animation system:
- The
AnimationManagerloads and manages all character animations - Animations are defined in a JSON configuration file for easy modification
- Each Lutemon type has unique animations for idle, run, attack, hurt, and die states
- Sprite sheets are used for efficient rendering
- Animation timing is carefully tuned for responsive gameplay
Several UI components handle the display of animations:
AnimatedAvatarshows Lutemons in menus and UIBattleCharacterrenders Lutemons during battles with proper positioning and flippingTrainingAnimationdisplays Lutemons during training sessions- All animations adapt to screen size for consistent appearance across devices
The game features a polished user interface with several custom components:
HealthBardisplays current and maximum health during battlesDialogsystems for creating new Lutemons and displaying battle resultsFragment-based UI organization for modular screen layouts- Responsive design that adapts to different screen sizes
Each game screen is implemented as a separate class:
MainMenuScreenprovides entry points to different game modesHomeScreenshows Lutemons at home and allows managementTrainingScreenhandles the training experienceBattleScreenmanages the battle arena and controlsStatisticsScreendisplays game statistics and achievements
The game includes a comprehensive save system:
SaveManagerhandles serialization of game state to JSONProfileManagersupports multiple player profiles- Game state includes Lutemons, their stats, and global statistics
- Auto-save functionality preserves progress at key points
The StatisticsManager tracks various game metrics:
- Total Lutemons created
- Total battles fought
- Total training sessions completed
- Individual Lutemon performance statistics
The AssetLoader class efficiently manages game resources:
- Textures for UI elements and backgrounds
- Texture atlases for animations
- Fonts and UI skins
- Fallback mechanisms for missing assets
Game parameters are centralized in the Constants class:
- Screen dimensions and scaling factors
- Training and battle parameters
- File paths for assets
- This makes balancing and tuning the game much easier
I've implemented several animation refinements for a polished feel:
- Smooth transitions between animation states
- Direction-aware rendering (characters face the correct way)
- Visual feedback for damage (color tinting when hurt)
- Carefully tuned animation timing for responsive controls
- Proper scaling of animations for different screen sizes
You can download the apk file from this link or build the game from source.
To build the game from source, follow these steps:
- Clone the repository.
- Open the project in your preferred IDE. I recommend using Android Studio.
- Make sure to have the LibGDX setup installed.
- Import the project as a Gradle project.
- Ensure that all dependencies are resolved.
- Build and run the project.