Java 2D turn-based game programming: handle 2 mouse clicks per player

Posted by Humberto Pinheiro on Stack Overflow See other posts from Stack Overflow or by Humberto Pinheiro
Published on 2010-03-13T14:05:08Z Indexed on 2010/03/13 14:15 UTC
Read the original article Hit count: 337

Filed under:
|

So suppose I'm developing a chess-like program using Java's Swing. I added a MouseListener to handle user input. To make a move the user must click a valid piece and then click a valid place. What's the best way to track the 2 mouse clicks in a turn? I'm thinking in use some kind of variable to record if is the turn's first click or second.

© Stack Overflow or respective owner

Related posts about java

Related posts about swing