Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 Minesweeper revisited (30 points) In this proble, we return to the Minesweeper game you wrote two assignments ago. First of all, if you did

image text in transcribed
1 Minesweeper revisited (30 points) In this proble, we return to the Minesweeper game you wrote two assignments ago. First of all, if you did not get f credit on this question on Assignment 3, you have a chance to earn back some points here. Return to your code, now that we have gone over it and you have seen how to construct a working version using good MVC design. Refactor and fix it until you have a working game. This will net you half the points you lost on assignment 3. For this assignment, you will enhance your Minesweeper game with a couple of features. Adda menu bar to your JFrame, with a "File" menu. This menu should include four menu items: "New Save", "Load" and "Quit" When a user selects "New", the game should elicit information about how difficult the new game shoud be. Exactly how this works is up to you specifying a gameboard size, odds of encountering a mine, or simply selecting a difficulty level . "Save" should save the current game state to disk. Present the user with a file chooser dialog for specifying a name and place to save the game. Hint: If you have implemented the MVC architecture well, this should be only a couple of lines of code "Load", by contrast, should load a saved game off the disk. Again, present the user with a file chooser. Handle the case where the user chooses a file that is not in fact a saved Minesweeper game. When the game has loaded, the board should look just like it did when the user saved it before. Hint: the removeAll) method of a JComponent (like a JPanel) removes everything inside, including any JButtons or other user interface elemnts. You can then add new elements that represent the new (or newly-loaded) game. Once you have done this, however, you must then call the JComponent's validate) method, which tells the JVM to fix all of the entries in its event-loop lookup table which you just messed up ."Quit" should simply end the program. The program should only quit when the user selects this option or clicks the JFrame's close box. If the game is lost, the user should be able to look at the revealed game board and then select "New" to start again. 1 Minesweeper revisited (30 points) In this proble, we return to the Minesweeper game you wrote two assignments ago. First of all, if you did not get f credit on this question on Assignment 3, you have a chance to earn back some points here. Return to your code, now that we have gone over it and you have seen how to construct a working version using good MVC design. Refactor and fix it until you have a working game. This will net you half the points you lost on assignment 3. For this assignment, you will enhance your Minesweeper game with a couple of features. Adda menu bar to your JFrame, with a "File" menu. This menu should include four menu items: "New Save", "Load" and "Quit" When a user selects "New", the game should elicit information about how difficult the new game shoud be. Exactly how this works is up to you specifying a gameboard size, odds of encountering a mine, or simply selecting a difficulty level . "Save" should save the current game state to disk. Present the user with a file chooser dialog for specifying a name and place to save the game. Hint: If you have implemented the MVC architecture well, this should be only a couple of lines of code "Load", by contrast, should load a saved game off the disk. Again, present the user with a file chooser. Handle the case where the user chooses a file that is not in fact a saved Minesweeper game. When the game has loaded, the board should look just like it did when the user saved it before. Hint: the removeAll) method of a JComponent (like a JPanel) removes everything inside, including any JButtons or other user interface elemnts. You can then add new elements that represent the new (or newly-loaded) game. Once you have done this, however, you must then call the JComponent's validate) method, which tells the JVM to fix all of the entries in its event-loop lookup table which you just messed up ."Quit" should simply end the program. The program should only quit when the user selects this option or clicks the JFrame's close box. If the game is lost, the user should be able to look at the revealed game board and then select "New" to start again

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part I Lnai 8724

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448475, 978-3662448472

More Books

Students also viewed these Databases questions

Question

Known for something in business circles?

Answered: 1 week ago

Question

What is a verb?

Answered: 1 week ago