aspose file tools*
The moose likes Game Development and the fly likes Queries about Ludo Logic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Game Development
Bookmark "Queries about Ludo Logic" Watch "Queries about Ludo Logic" New topic
Author

Queries about Ludo Logic

Sadaqatullah Noonari
Greenhorn

Joined: Mar 22, 2011
Posts: 13
I trying to make a Ludo game. I have made engine that works with only 1 player i.e. it only runs with 1 player. I have tried hard to work make it work with two or more players but could not succeed. I have made an object for 1 player but when I make objects for other players, I don't get the desired result in the command output. such as I want this output in the command output:

-y-b--y-b--y-b---y-b--y-y ( the 'y' is twice because its overlapping the b in the same position.)

Where as I am getting the following result:

---b----b----b-----b----b
-y----y----y-----y----y-y

please need help in solving the problem
Ashish Schottky
Ranch Hand

Joined: Dec 29, 2009
Posts: 93
@Original Poster: Well I read your questions few times,before I could get what you are asking for.
My suggestions are:
1)Please Post some code with comments which will help fellow ranchers to take a look and let you know what is going wrong.
2)Create an simple array[][] which will keep the board condition.
3)write separate methods method for different of players.// public int[][] Player1(int[][]board){ int piece_color,int sq; .. use your logic here, return board; }
4)write a method which toggles players (hint use a counter, and switch statement).

If you are still stuck, then kindly post some part of you code which might help to see where the thing goes wrong.
-Take Care.
Sadaqatullah Noonari
Greenhorn

Joined: Mar 22, 2011
Posts: 13
Ashish Schottky wrote:@Original Poster: Well I read your questions few times,before I could get what you are asking for.
My suggestions are:
1)Please Post some code with comments which will help fellow ranchers to take a look and let you know what is going wrong.
2)Create an simple array[][] which will keep the board condition.
3)write separate methods method for different of players.// public int[][] Player1(int[][]board){ int piece_color,int sq; .. use your logic here, return board; }
4)write a method which toggles players (hint use a counter, and switch statement).

If you are still stuck, then kindly post some part of you code which might help to see where the thing goes wrong.
-Take Care.


Thanks that worked. and gave correct results
 
Don't get me started about those stupid light bulbs.
 
subject: Queries about Ludo Logic