1 / 5

Java

Java. Finish command line guessing game, then…. GUI Guessing Game. GuessingGame. GuessingGameUI extends javax.swing.JFrame. GuessingGame. target: int gameOver : boolean statusMsg : String. - game: GuessingGame. target: int gameOver : boolean. + GuessingGameUI ()

Download Presentation

Java

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Java • Finish command line guessing game, then…

  2. GUI Guessing Game GuessingGame GuessingGameUIextends 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

  4. 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…

More Related