This project is a digital implementation of the classic board game Ludo, designed using Object-Oriented Programming (OOP) principles. The game allows for both human and AI players, providing an engaging gaming experience while demonstrating core OOP concepts such as encapsulation, inheritance, and polymorphism.
- Features
- Classes and Their Responsibilities
- Gameplay Instructions
- AIPlayer Development Status
- Naming Conventions
- Support for multiple players, including human and AI players.
- Dice rolling mechanics to determine movement.
- Piece movement and capturing mechanics.
- A user-friendly interface with visual representation of the game board.
- Manages the overall game flow, including player turns, dice rolls, and game state.
- Represents a player in the game. Manages the player's pieces and provides methods for movement and capturing.
- Inherits from
Player
and handles user input for selecting pieces and making moves.
- Inherits from
Player
and implements automated gameplay logic, determining the best moves based on the current game state.
- Represents a game piece, managing its position, state (in lobby, on board, or at goal), and movement logic.
- Represents a dice object, handling the rolling mechanics and providing the rolled value.
- The game can be played with 2 to 4 players.
- Each player takes turns rolling the dice and moving their pieces according to the rolled value.
- Players can capture opponent pieces by landing on the same space.
- The first player to get all their pieces to the finish line wins the game!
The AIPlayer
class is currently under development and aims to implement automated gameplay logic for the game. Here are the key objectives and features expected from the AIPlayer
:
-
Automated Decision-Making: The
AIPlayer
will evaluate the game state and make decisions without requiring user input, simulating a human player's actions. -
Movement Logic: It will determine which pieces to move based on the rolled dice value, ensuring optimal moves to achieve victory.
-
Heuristics and Simple Rules:
- Maximum Advancement: The AI will choose the piece that can advance the most based on the dice value.
- Aggressiveness: The AI will prioritize capturing opponent pieces when possible.
-
Strategic Decision-Making:
- The AI will prioritize moving pieces closer to the goal while also protecting its own pieces from being captured.
As of now, the AIPlayer
is in progress and does not yet have fully implemented logic for decision-making. Future updates will focus on building out the update
method and integrating the necessary algorithms to fulfill the objectives outlined above.
- Format: Use
snake_case
for naming variables, functions, modules, and packages. - Examples:
- Variables:
total_sum
,user_age
,max_value
- Functions:
calculate_area()
,fetch_user_data()
,validate_input()
- Modules:
data_processing
,user_management
,payment_gateway
- Packages:
my_package
,utils_module
- Variables:
- Format: Use
PascalCase
for naming classes. - Examples:
UserProfile
,OrderManager
,DataProcessor
- Guideline: Abbreviations are allowed when they are widely recognized (e.g., use
info
instead ofinformation
).
- Guideline: Comments can be written in English or Portuguese, but should only explain the why of the code, not the how it works.
Following these conventions is essential for maintaining consistency and readability throughout the project. Non-compliance may lead to code that is difficult to maintain and understand.