okay so I'm kinda new to game development
so I have this game where I need to switch turns after each mouse click the way I forth I cut due this was to put this code inside the update part
if((mouseX>25&&mouseX<195)&&(mouseY<605&&mouseY>435)){
if(Mouse.isButtonDown(0)){
if(playTurn ==1){
places[1] = 1;
playTurn = 2;
}else if(playTurn ==2){
places[1] = 2;
playTurn = 1;
}else{
}
}
}
but it's simply updating to fast so when the user holds down the mouse button / clicking slow it don't just switch turn 1 time but maybe 100 times witch I don't want I need it to only switch turn one pre click no matter what how can I do this ??
have been traying to fix this bay using thread but i'm not good at using threads
sry for my english






