File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Game Development and the fly likes Queries about Ludo Logic Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Game Development
Reply 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: 10
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: 10
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
 
 
subject: Queries about Ludo Logic
 
Threads others viewed
Loop for players
why can't some people play my game
Can someone test my game again?
Coding questions
Alpha beta pruning with negamax
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture