Question: This week we start working a game that will be extended over the next three weeks. It is a simple game of finding treasures. Below
This week we start working a game that will be extended over the next three weeks. It is a simple game of finding treasures.
Below is low-fidelity mock-up of what the game can look like.
TreasureHuntGame.PNG
Implement the user stories below one at a time in the order given.
Week 1
Game Features
Create UI similar to the illustration
Use fonts, color, images etc. to make the game look interesting
The treasure field is 10 by 10 locationsEach location can be clicked to reveal
A treasure, or
Nothing
Treasures Left shows the number of treasures left on the board starting with 20
Treasures Found shows the number of treasures the user has found
Tries Left shows the number of clicks on the board the user has left
Counting each field only once
The game starts with 50 tries available
Last Move shows whether the last click on the board revealed a treasure, a miss, or if the game is over.
User Stories
As a user, I can see the title of game so that I know what I will be playing.
As a player, I can see a board of 10 by 10 locations where I can click, so that I can play the game.
As a player, when I click on a location on the board where there is a treasure, the Treasures Left is reduce by one, and the Treasures Found is increased by one , so that I can see how successful I have been so far.
As a player, when I click on a location on the board, the location changes so that I can see if there was a treasure randomly placed at the location.
As a player, I can see how many treasures that are hidden on the board, so that I know how far away from winning I am.
As a player, I can see how many treasure that I have discovered so far, so that I can see how successful I have been.
As a player, I can see how many of the 20 tries/turns I started with are left, so that I can see how far I have to go.
As a player, when I click on a location on the board, the Tries Left is reduced by one, so that I know how many tries I have left .
As a player, when I click on a location that I have already clicked, nothing happens, so that I cannot fake finding treasures.
As a player, when I click on a location, the Last Move fields shows: "Miss" - if there was nothing at the location "Treasure" - if there was a treasure at the location "Game Over - You win" - if there are no treasures left "Game Over - You lose" - if there are treasures more left but no tries
As a player, when I have no more tries left, clicking on the board locations does nothing.
As a player, when I have no more tries left, I can see where all the treasures are on the board.
Technical Implementation
Implement each story one at a time in the order given.
Keep each class in a separate file.
Use the CRC card format from the Chapter 8 (p. 547-548) to explain in a comment right before the class definition what the responsibilities and functions of the class are.
Use a border layout for the main window (or another layout that allows the design above).
Use a grid layout for the board and two nested for-loop to populate the board.
Extend the JButton class to create a BoardButton class instances of which are the contents of the board
Set the default text or icon for an unclicked button in the constructor
Make the button disabled when it is clicked.
Extend the JButton class to create a TreasureButton class instances of which are on the board
Change the look of the button when a user clicks on it: change the text or the icon
As you create the buttons, keep them in an array so that you can easily access them later.
Do not use break outside of switch statements; do no use instanceof at all.
The main method should simply contain: new TreasureGame().play();
Keep the code tidy (with comments and indentation) because you will be building on it over the next weeks.
Submit one zip file with the entire project folder. Be sure to include all comments and to indent consistently as you will not be able to resubmit after the deadline.
Write a user's guide document to the game, including screenshots of the game in play.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
