I have 1 week guys. I need your help. I am making a game called ludo using c++. These are game instructions. https://www.mastersofgames.com/rules/ludo-rules-instructions-guide.htm The respective piece will move anticlockwise in boxes. The game will initiate by any player E.g If we throw the dice on the board and 5 comes, the piece will move 5 boxes. I am not getting the logic to move the respective piece on its path.
note my code may have errors, I haven't done console c++ in a while, but you can see the basic idea :)
if its a console game to makea random number system just make a variable like:
1 2 3 4 5 6 7 8 9 10 11 12 13
int randomDiceNo = 1+rand()%5;
int position;
now do all the if statements so FOR EXAMPLE:
if(randomDiceNo == 2)
{
position =+ 2;
cout<< "The player has now reached moved to" <<position;
}
Nope! I know there will be use of arrays. Whatever comes on dice will be passed on a function. That function will decide the boxes it moves. But the problem is how will the piece move to upper boxes. The path is like a rectangle. Another problem that each player has 4 pieces. I am not getting the logic. 4 pieces! And its the choice of user to select the piece which are free to move to move along the boxes . So there will be use of switch case.
Final semester project in FAST CFD? :P Section C, I suppose.
Well, you won't ever get the whole code, will have to start the work on it yourself and then you could ask for help depending upon different problems you might face.