0
\$\begingroup\$

I am working on J2ME. I have got a canvas, with a layout of a Checkers board. At the position of pieces, I have placed images. The point at which I got stuck is, how to select/highlite a piece's image for a move. I can't figure out the appropriate commandListener and how to handle this keyPressedEvent. I understood the logic of this game from: Draughts AI

Any suggestions?

\$\endgroup\$
0
\$\begingroup\$

there's always an array like DS representing the chess, always a current position, always a target position. always highlight the current position. after press a button, you change the status of the chess, and then you select another position ..... basically what I suggested is you need to think in state machine based model.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.