Create a meaningful shape in the middle band

Assignment Help Basic Computer Science
Reference no: EM13307104

Write a Java application called NewTetris that allows a new way to play Tetris. It is well known that in Tetris there are seven kinds of tetriminos, each of which is made up of four minos.The application window is divided into three bands: top, middle and bottom. When the application starts, seven different tetriminos will appear within the top band, as shown in the Java applet below. These seven tetrinimos are referred to as model tetriminos. A user can add tetriminos into the middle band tocreate a meaningful shape. A tetrimino that is no longer useful can be deleted byputting it into the bottom band.

Specifically, a user can perform the following four operations to create a meaningful shape in the middle band.

Add: to add a tetrimino, a user can use the left mouse button to drag the corresponding model tetrimino located within the top band. When a model tetrimino is selected to be dragged, a duplicate is made out of the model. It is the duplicate that is actually dragged. The model tetrimino stays at the same location.

Move: To move a duplicate tetrimino, use the left mouse button to drag it. The model tetrimino can't be moved.

Rotate: To rotate a duplicate tetrimino, use the right mouse button to click one of its four minos. Please note the tetrimino will rotate about the center of the mino that is clicked. The model tetrimino can't be rotated.

Delete: at the end of the moving or rotating operation, if the tetrimino intersects with the bottom band, the tetrimino will be deleted. Since a model tetrimino can't be moved or rotated, it can't be deleted.

Requirements/Recommendations:
You shall write a class named CMino to describe a mino.
You shall write a class named CTetriMino to describe seven different tetriminos.
You can use collections to keep a record of all the tetriminos added so far.
Use event handlers to add, move, rotate and delete a tetrimino.
After rotating a point (x1, y1) about another point (x0, y0) counterclockwise through an angle of theta in radians, its new location (x2, y2) can be represented as follows.
x2=x0+(x1-x0)*cos(theta)-(y1-y0)*sin(theta)
y2=y0+(x1-x0)*sin(theta)+(y1-y0)*cos(theta)

Reference no: EM13307104

Questions Cloud

Types of recruiting methods : Describe the following types of recruiting methods: online recruiting, job fairs, and employment agencies. Explain when you would most likely use each of them (i.e., what kind of jobs), and why (at least one reason each)
What uid and pid have the highest amount of physical memory : What UID and PID have the highest amount of physical memory a process has used and is not swapped out? Show all processes and full output.
Determine the weight of the heaviest bear : The density of ice is 917 kg/m3, and the density of sea water is 1025 kg/m3. What is the weight of the heaviest bear that the ice can support without sinking completely beneath the water
The potential for doctoral level research : From your experience (observable events) and the literature reviewed, formulate 3 to 5 possible topic areas of interest. These topics should have the potential for doctoral level research.
Create a meaningful shape in the middle band : Specifically, a user can perform the following four operations to create a meaningful shape in the middle band.
What are the primary types of medical research : What are the primary types of medical research, and how does each type functions to help American health care advance over time? Would you personally like to be involved in conducting one of these types of research? Why, or why not?
Determine the volume of the object : An object is solid throughout. When the object is completely submerged in ethyl alcohol, its apparent weight is 15.8 N. What is the volume of the object
Product market analysis : Research Paper: Product Market Analysis, Business to Business Marketing
Describe at least 3 tables that might be used to store : Describe at least 3 tables that might be used to store information in social-networking system such as Facebook.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  . use a looping statement and assume that each iteration

. Use a looping statement and assume that each iteration is equivalent to one year. 3. Save the document as Week4.php Note: Each movie you rent out is $5.

  Resolve this problem within wireless technology

You can resolve this issue by wiring but you do not want to do that. What can you do to resolve this problem within wireless technology?

  Edit this java code add the 3 amounts

Can anyone pls edit this Java code? I need to be able to add the 3 amounts listed on the main method public class Money { private Currency currency; private int wholenum; private int decnum; public Money(Currency currency, int wholenum, int decnum..

  Assume the sequence numbers are properly sized

What suggestions would you make to your colleague to fix the protocol? Assume the sequence numbers are properly sized.

  How could a business use information technology

How could a business use information technology to increase switching costs and lock in its customers and suppliers? Use business examples to support your answers

  Why ratings for high quality pages must all get same rating

Ratings for high quality pages should all get the same rating. For example, a high quality page for a common interpretation of the query should get the same rating as a high quality page for a minor interpretation of the query.

  Dis-assemble each of the following

Dis-assemble each of the following MIPS R2000 object code into source code instructions. Use register names, such as $t2, instead of numbers, such as $20.

  Where each instruction is bits wide

A DMA module is transferring characters to main memory from an external device transmitting at 500,000 bits per second (bps). The processor can fetch instructions at the rate of 1 million instructions per second where each instruction is 64 bits w..

  What will the following pseudocode program display

What will the following pseudocode program display

  The case sstudy on an digital forensic investigation plan

As part of the auditing team in capacity of a Digital Forensics expert, your task is to prepare a report explaining the possible methods that can be adopted in this particular scenario, resources required for the methods chosen for this investigat..

  Create two-page written analysis for problem statement

Create a two-page written analysis based on the following specification: Problem statement, Possible outcomes if no action taken (this one is mine and the only thing i have to do) Alternative actions.

  Create an html5 document that contains an unordered list

Create an HTML5 document that contains an unordered list with links to the following examples headings, email, images as hyperlink these are from textbook, special characters, tables, HTML5 forms, and internal links to be included

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