Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The Treasure Hunt Game Game Features Create UI similar to the illustration Use fonts, color, images etc. to make the game look interesting The treasure

The Treasure Hunt Game

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 of the 20 treasures 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 50 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.

echnical Implementation

These are the instructions for the 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 BoardButton 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.

The main method should simply contain: new TreasureGame().play();

Do not use instanceof, or break, except inside of switch statements.

New Game Features

The board now also contains 20 trolls that will take away all your treasure if you land on one!

20 distinct trolls (not on top of each other or a treasure)

User Stories

As a player, when I click on the board, in addition to a treasure or nothing, I may encounter a troll at random positions.

As a player, when I click on the board and encounter a troll, the troll is always one position in away from a treasure in the horizontal and vertical directions.

As a player, when I click on a troll, I lose all your treasures.

As a player, when the game is over, I can see where all the treasures and trolls are located on the board.

Technical Implementation

Follow the these directions:

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. Be sure to have a Responsibilities and a Collaborating Classes sections.

Extend the BoardButton (or JButton class, depending on what you did in the first week) to create a TrollButton 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

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

Database Systems Design Implementation And Management

Authors: Carlos Coronel, Steven Morris

14th Edition

978-0357673034

More Books

Students also viewed these Databases questions