Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 0 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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