I'm starting to make a checkers game and I've got all my graphics + the board drawn. Before I moved on to creating the pieces I was wondering what an easy way to tackle the logic side of the movement of pieces.. Should I make a table of every square, detecting if it has a piece and if so, what color? (i.e 0=empty, 1=red, 2=black) or do you guys have a better idea to this issue? Thanks in advance.
|
closed as not constructive by Byte56, Jonathan Hobbs, bummzack, Nicol Bolas, Josh Petrie Oct 19 '12 at 17:38
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.
|
I'd just have a two dimensional array of Space objects. Don't know how you're rendering each space, but the Space object could say if it's occupied by a piece, and if so, what is the color, etc. |
|||||||||
|
|
I once wrote a reversi game and I just used a table of values for each square and it worked fine assigning a number to each possible state. When you move a piece you would have a function that would check if a move is legal then erase where the piece from one square and put it in the next one. I'm sorry if I missed something applicable but I don't actually know how to play checkers. |
|||
|
|
