Time to dig in

I’ve decided that my first real jME app is going to be a game of checkers. Initially 2 player and then add in some simple AI in a future version. Then on down the road, if I don’t have other pressing matters, networking.



Anyway, I feel I have a good enough grasp of jME to get started on this as far as the 3D scene goes. Where I feel I am going to be stumped is what kind of data structure I am going to build to represent the 3D board in 2D so that I can determine what pieces are where.



What I wanted to know is if anyone has any suggestions, hints, or tips about this. I had 2 thoughts about how to construct the board.

  • A single Box (or mesh of some sort) that represents the entire board with a single texture layed on top.
  • Each square on the board is it's own mesh (Box, whatever)
    [/list:u]

    Would anyone suggest one over the other? And reasons why? I'm not looking for a *solution* here but I would appreciate some guidance.

    Thanks. As always, jME rocks! :)

If you don’t need to worry about animation you can make every “spot” have a piece in it.



Each “spot” has three states off, red, black



You can just detach the node at the spot for off



Put on a red texture for red and put on a black texture for black



That way you can lay all your nodes where you want them using setLocalTranslation and not have to worry about moving nodes around after the board is set up, just changing states.



You can then make a 2d array mimic the state of the board (0=off, 1=red, 2=black) or somethign like that. Do all your game logic on the array and then update your board based on the array.



That’s the first idea that came to mind for me.



Good luck on your project!

If it were me, I would make each space it’s own mesh. This way picking would be much easier, just have to do bounding collision.

hehe … yeah … what mojo said :wink:

Thanks for the suggestions. I definatly want to have animation. What fun is 3D without animation? :wink: