This Blog is about Console Based LUDO game made in C++.
Before Getting Started let me share with you some of the information about LUDO game.
"Ludo is a strategy board game for two to four players, in which the players race their four tokens from start to finish according to the rolls of a single die. Like other cross and circle games, Ludo is derived from the Indian game Pachisi, but simpler."
The Traditional LUDO board look like this:
For more information about LUDO Click Here.
Now let gets started :
Things I have Done in this Game:
MAIN MENU:
After the Loading Screen A Menu Appears :
- Option 1 is to Play New Game. Following Screen will appear after clicking this Option
- Option 2 is to Load Games that are Saved. This Window will appear on clicking this Option
- Option 3 is to see Rules of Game.
- Option 4 is ABOUT me.
- Option 5 is to EXIT.
KEY FEATURES:
- This Game can be played with any number of TOKENS.
- This Game can be played with any number of PLAYERS.
- This Game can be saved at any time and then will load from the Same Place.
GAME PLAY:
- I have used C++ rand() function form cstdlib library to generate die numbers From 1-6 and also srand() function which is also from cstdlib to generate different random numbers every time I run the program. For More details about rand() and srand() Click Here
- For the first Time when there is no token out on the board and die number is also not SIX then the turn will pass over to next player and will continue to pass over until a player gets a SIX.
- If the player gets the SIX for the first time, he will be given the choice to bring the token out of his own choice.
- After Taking the token out he/she will be given a BONUS TURN for taking the Token Out.
- Now, the player who has the token out can move his token while other player would wait for their die number to be SIX.
- If the Token of one player comes in position of another player (except the starting point) the token of the former player will be killed and the later player will be given a BONUS TURN.
- Token will not be allowed to move at the position at which there is Token of the same player is present and player will be given the choice to move his another Token (if there is one).
- If the player gets SIX die number for the second time he will be given choice to Bring Another Token Out (Until there is no other Token of the same player present) or he/she can move the Token Forward that is already out there.
- If the Player brings the Token Out and there is already a token f other player at the starting point of the Later player, the token of the former player will be killed and the later player will be given BONUS TURNS on both Killing the Token and Bringing the token Out.
- The player will not be given a choice to bring the token out when the die number is SIX and there is no token available to bring Out.
- If the player is lucky Enough to reach the End Position, he/she will be Given the BONUS TURN on taking the token to home.
- The player whose all tokens reached the End Position will Win the Game.
- The user has the option to Save the Game by clicking 'S' at the start of every Turn. After Saving it can be Loaded from Option 2 of MAIN MENU
- Unfortunately, due to some limitation there are no Stopping Points other than Starting Points as there are in traditional LUDO.
SAVING GAME:
While playing game, there is a option given to user to Save the Game by simply Pressing 'S'. For storing this game I am using Binary File named "SavedGames.ludo".Basic concepts of File Handling and cpp struct are used for this purpose. All the saved games will appear in 'PLAY SAVED GAMES' option in Menu.
Watch Complete Game Play Here:
SOURCE CODE:
This program is written on Visual Studio Community 2019. It may or may not compile on your IDE. So, if it does not compile you can use 'LUDO.exe' to see Game.
You can download Source Code and .exe file by clicking the button below:
Thanks for reading the Blog Let me know if you have any difficulty in the comments section below:). Have A Nice Day!
While playing game, there is a option given to user to Save the Game by simply Pressing 'S'. For storing this game I am using Binary File named "SavedGames.ludo".Basic concepts of File Handling and cpp struct are used for this purpose. All the saved games will appear in 'PLAY SAVED GAMES' option in Menu.
Watch Complete Game Play Here:
SOURCE CODE:
This program is written on Visual Studio Community 2019. It may or may not compile on your IDE. So, if it does not compile you can use 'LUDO.exe' to see Game.
You can download Source Code and .exe file by clicking the button below:
Very informative, keep up the good job👍🏻
ReplyDeleteThanks ❤
DeleteWell done 👍
ReplyDeleteLove you
ReplyDelete❤️
DeleteThere are errors in this code at line no. 66,72 and 73. Can you please send the correct code.
ReplyDeleteIs vs path not setup?
DeleteI have compiled this code on Visual Studio Community 2017. It was working fine. If its not running you can make changes to the code according to the errors given by your IDE. BTW, I have also attached .exe file, you can run it
DeleteI want to run it in code blocks but getting error plz I need correct code
ReplyDelete