Hello, I'm making a Genius game, one that needs to select colors in the right order ...
And I'm having a hard time playing the part of the player ...
public void jogadorJoga(){
}
In this method I need to make the program wait for the user to push the button, and thus check if the selected color is correct, but the part of making the program wait I have no idea how it could be. I was thinking of creating a variable to save the selected color, and then check if it's right, does anyone have a hint?
edit:
I created a game in which it creates a sequence of colors and this sequence is added in a "List", then shows the sequence by flashing the buttons in a swing with 4 buttons (blue, red, green, yellow) p> Now, the part I need to do that I'm not getting is the part of the player, he needs to select the colors in the right order, but I got lost there, I do not know how he makes the program expect to receive the clicks of the player, my idea, I would have to do a while (true) and when the button is pressed it goes out of this while and saves the color in a variable? I do not know the right way to do this. I'm a beginner in Java.