Download presentation
Presentation is loading. Please wait.
1
Java Finish command line guessing game, then…
2
GuessingGameUI extends javax.swing.JFrame
GUI Guessing Game GuessingGame GuessingGameUI extends javax.swing.JFrame GuessingGame target: int gameOver: boolean statusMsg: String - game: GuessingGame target: int gameOver: boolean + GuessingGameUI() + btnNewGameActionPerformed(evt: java.awt.event.ActionEvent): void + btnGuessActionPerformed(evt: java.awt.event.ActionEvent): void + processGuess(guess: int) + getMsg(): String + isGameOver(): boolean + newGame(): - setTarget(): void GuessingGameApp <no fields> + main(args: String): void
3
Important Points Remember that your GuessingGame class doesn't just run from start to finish, it responds to the requests from the UI Note that there is no main loop! Get your parameters and return types correct for you GuessingGame methods The UI passes information to the GuessingGame and updates the UI on the basis of what it gets back
5
Extending the game Ask the user for confirmation if they start a new game before the old game was finished Allow the user to set the upper bound for the random target Keep a count of the number of tries and display it on the GUI Keep a list of high scores (requires file handling, which you have not been taught but which is on the blog…) Other ideas? Please share…
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.