Write my Paper Freezing tag game

 

 

write a program to simulate a game we will call “Freeze Tag”. Five rectangles start on the screen at random locations. When created, these rectangles have different widths and heights and different
x and y velocities. The width, height, and x and y velocities of each rectangle will not change during the game. The starting position, width, height, and x and y velocities should be used as
parameters to the constructor.
The rectangles move around the screen bouncing off the walls. Each time a rectangle bounces off a wall, its color changes to a new random color. The player uses the mouse to try to click on the
rectangles. If the player successfully clicks on a rectangle, the rectangle will freeze and turn red. If the player can freeze all five rectangles, he or she wins.

Here’s what a playthrough of the game should look like:
Animated GIF - Find & Share on GIPHY

What to do
Even though these items are listed step by step, design is an iterative process. You should plan to revisit these steps several times to revise and polish your code.
Step 1: Design a MovingRectangle class. Questions you should consider:
What attributes (instance variables) does a MovingRectangle have?
What behaviors (methods) might it need? What should the rectangle be able to do?
What methods will have a void return type?
Which methods will need to return information?
Step 2: Write the beginning of your MovingRectangle class. (Start small, test often!)
Write a class outline.
Add the instance variables.
Think about what parameters the constructor should have.
Write the constructor.
Test the constructor.
Step 3: Add the other methods to your MovingRectangle class. (One at a time, test often!)
Step 4: Get the game working with one rectangle.
Step 5: Create an Array which can store 5 MovingRectangle objects.
Step 6: Load each cell of the Array with a MovingRectangle object.
Step 7: Change the main method so that each MovingRectangle object moves and is drawn on the canvas.
Step 8: Add the text that will display “You Win!” on the screen when all rectangles are frozen.

 

Is this question part of your Assignment?

We can help

Our aim is to help you get A+ grades on your Coursework.

We handle assignments in a multiplicity of subject areas including Admission Essays, General Essays, Case Studies, Coursework, Dissertations, Editing, Research Papers, and Research proposals

Header Button Label: Get Started NowGet Started Header Button Label: View writing samplesView writing samples