Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Game Description

As the game progresses, columns of three different symbols (such as differently-colored blocks) appear, one at a time, at the top of the playing area and fall to the bottom, landing either on the floor or on top of previously-fallen "columns". While a column is falling, the player can move it left and right, and can also cycle the positions of the symbols within it. After a column lands, if three or more of the same symbols are connected in a horizontal, vertical, or diagonal line, those symbols disappear. The pile of columns then settles under gravity. If this resettlement causes three or more other symbols to align, they too disappear and the cycle repeats.

Problem Specification

You are going to create a BlockManager class to handle your block bookkeeping. You will demonstrate its functionality in a BlockManagerTest class. (You likely will want some additional classes/interfaces to accomplish this, but I leave that design up to you.) The BlockManager should be independent of any future GUI code.

BlockManager

Although the actual game will have a fixed board size, your class should be able to handle arbitrary positive values for the number of rows and columns.

Your class must provide the following functionality.
- Construct a new manager with given number of rows and columns.
- Generate random column pieces using some number of symbols.
o The final game will use random pieces, but for this test program you should have reproducible results each time it is run.
o One simple way to have "random" behavior that can be repeated is to use a Random object that has been initialized with a fixed seed.
- Override toString to provide a string representation of your board.
- Add a new piece to the board in a specific column position. Determine which blocks will be part of a horizontal, vertical, and/or diagonal line of at least 3 blocks of the same color.
- Remove blocks from the board and drop pieces.
o Given a line (or lines) of matching blocks, remove them from the board.
o Any blocks above the removed blocks should fall down to fill the empty space.
o Check for any matching lines formed as a result.
BlockManagerTest
The purpose of this testing class is to demonstrate to us that your block manager works correctly, so you need to put it through its paces.
o You should create at least two BlockManager objects with separate sizes and symbols. Demonstrate that they operate independently of each other. (I want to make sure that you aren't locked in to just one configuration and that you aren't making things static inappropriately.)
o Test adding columns and dropping blocks on each manager.
- Print out the string representation of the manager before you begin. - Add a new piece to the board.

1. Print out the block manager after the addition.

2. Print out how many blocks are in lines and should be removed. (May be zero if there are no lines formed by the drop.)

3. Remove the matching lines and drop blocks.

4. Print out the resulting block manager.

5. Print out how many blocks need to be removed as a result of new matching lines formed by the dropped blocks.

6. Repeat from 3 until no more matches are formed.

7. Add more pieces. Don't use the same position or piece every time. Demon- strate horizontal, vertical, and diagonal matches. Demonstrate lines formed by dropped blocks.
- After demonstrating each manager, repeat the tests with the first manager again to prove that it is independent of the second.
- Don't just copy and paste the same test code for each manager. Structure your code sensibly with methods rather than writing one giant main method.
- Your testing output should come from BlockManagerTest, not BlockManager. Don't put console output in the middle of your block manager logic.
- I am providing you with example output from my testing code to give you an idea what I'm expecting this to look like.

Attachment:- output.rar

Java, Programming

  • Category:- Java
  • Reference No.:- M92394919
  • Price:- $15

Priced at Now at $15, Verified Solution

Have any Question?


Related Questions in Java

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

Project requirementsfor the problem described in the next

Project requirements For the problem described in the next section, you must do the following: 1. include your student ID at the end of all filenames for all java code files. Three classes have been identified in section ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Assignment game prototypeoverviewfor this assessment task

Assignment: Game Prototype Overview For this assessment task you are expected to construct a prototype level/area as a "proof of concept" for the game that you have designed in Assignment 1. The prototype should function ...

Assignment - method in our madnessthe emphasis for this

Assignment - "Method in our Madness" The emphasis for this assignment is methods with parameters. In preparation for this assignment, create a folder called Assign_3 for the DrJava projects for the assignment. A Cityscap ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As