java.lang.Object taylor.BarnyardSimon.HandleGameButton
private class BarnyardSimon.HandleGameButton
This class listens solely for game play buttons to be pressed. Once pressed, this class determines which button was pressed and then advances game play appropriately.
Constructor Summary | |
---|---|
BarnyardSimon.HandleGameButton()
|
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent event)
Handles an action event caused by one of the four colored buttons in Barnyard Simon. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
private BarnyardSimon.HandleGameButton()
Method Detail |
---|
public void actionPerformed(java.awt.event.ActionEvent event)
The method first determines if the correct button was pressed.
If not, the game has ended and the method must ensure that the high score is updated (if necessary) and resets the label on the start button and enables it.
If the correct button is pressed, then the button is activated and the current count of how many buttons in the sequence the player has pressed correctly must be incremented. If the player has pressed all of the buttons in the sequence correctly, the method must ensure that the sequence with one additional entry be played.
actionPerformed
in interface java.awt.event.ActionListener