Create a blockmanager class to handle your block bookkeeping

Assignment Help JAVA Programming
Reference no: EM131586205

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

Reference no: EM131586205

Questions Cloud

Write a program to play the rock-paper-scissors game : Write a program to play the rock-paper-scissors game. Two users take turns entering R, P, or S. The program then announces the winner, based on the rule
Evaluating projects : Gold mining is using the profitability index (PI) when evaluating projects. Gold-mining's cost of capital is 7.75%. what is the PI of a project
Multicultural education an example of cultural pluralism : Why is the concept of bilingual/multicultural education an example of cultural pluralism
Calculate the beta portfolio : You hold a portfolio with the following securities: % of portfolio BETA Stock A 53% 1.67 Stock B 11% 1.42 Stock C please calculate 1.68
Create a blockmanager class to handle your block bookkeeping : You are going to create a BlockManager class to handle your block bookkeeping - Although the actual game will have a fixed board size
Describe how each of the living arrangements : Describe three different common living arrangements for emerging adults. Describe how each of the living arrangements chosen might affect the emotional
Did business laws change as a result of this situation : Did business laws change as a result of this situation? If not, do you think a law should be changed or created? Explain.
What is radiography : What is radiography? Describe what is happening within a particle when radioactive emissions alpha, beta and gamma are produced
Does the conclusion tie into first three sentences in though : Does the conclusion tie into the first two or three sentences in thought? Is the wording smooth to read? Is proper grammar used?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd