This is a multiplayer implementation of the classic Snakes and Ladders game in Java. It includes the following features:
- Multiplayer game: Supports multiple players.
- Customizable board size: The board can be of any square size.
- Snakes and Ladders: Includes custom entities for snakes and ladders.
- Non-colliding entities: Ensures that the start and endpoint of snakes and ladders do not collide.
- Customizable dice: The game uses a customizable dice that produces random numbers.
- Runnable code: The code is ready to be executed.
To run the Snakes and Ladders game, follow these steps:
- Ensure that you have Java installed on your system.
- Clone or download the repository to your local machine.
- Open the project in your preferred Java development environment.
- Compile and run the
Main
class.
You can customize various aspects of the game:
- Board Size: Modify the size of the board by providing a different value when creating the
Board
object in theMain
class. - Snakes: Add or modify snakes by creating
Snake
objects with the desired start and end positions and adding them to the board using theaddEntity()
method. - Ladders: Add or modify ladders by creating
Ladder
objects with the desired start and end positions and adding them to the board using theaddEntity()
method. - Dice: Customize the dice by providing a different number of sides when creating the
Dice
object in theMain
class.
- When you run the game, you will be prompted to enter the number of players.
- After entering the number of players, the game will start.
- Players take turns rolling the dice and moving their tokens on the board according to the dice roll.
- If a player lands on a snake, they move down to the snake's tail.
- If a player lands on a ladder, they move up to the ladder's top.
- The game continues until one of the players reaches or exceeds the final position on the board.
- The winner of the game will be displayed at the end.
Contributions to this Snakes and Ladders game project are welcome. If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.
This Snakes and Ladders game is released under the MIT License.
This game implementation was created by Virag Jain