Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Your task is to recreate the following simple game Balloon Pop. Balloon Pop has red and green balloons that fall from the top of the

Your task is to recreate the following simple game Balloon Pop.
Balloon Pop has red and green balloons that fall from the top of the screen - the player clicks anywhere inside a balloon with the mouse to pop it.
Popping a green balloon adds to the score, popping a red balloon subtracts from the score.
Please read all the instructions before you start. You will be developing the game in 3 incremental stages. Each stage carries 10 marks. You must submit 3 versions of your game at these 3 different stages of completion.
Generic Instructions
All solutions must be written in Java.
You are highly recommended to use GameEngine.java and you are allowed to modify it if you wish.
Try to complete as many features as you can within the time available, marks will be awarded for partial solutions.
The balloons do not have to look like those in the following screenshots, a solid circle is fine.
Submission Instructions
Upload your code (in a .zip file generated by IntelliJ or the IDE of your choice) using the upload forms for questions 1,2 and 3.
This test is an individual test, do not share any details of it with other students. You may not copy any code from other students but you can use code from any of the course examples or your assignment 1.
Comments
If you wish to make any comments about decisions you made or problems you encountered, please enter them in the text field for each question.
Stage 1(10 marks)-
The game window is 500x500 pixels with a black background.
Balloons have a random radius of between 20 and 40 pixels. You are free to choose the method to create the balloons - either geometrically create them or use opensource images.
There is a 50% chance that a balloon is red and a 50% chance that is is green.
Balloons start with their centre at a random x position between their radius and the width of the window minus the radius.
Balloons start with a y position of minus the radius (i.e. off the top of the screen).
The speed of the game is determined by a variable speed calculated as follows:
speed=(time since game has started in seconds)/10.0+1.0;
Balloons have a constant random y velocity between 0 and 100 plus (speed *50) pixels per second (speed*50 ~ 100+ speed*50)
The time (in seconds) between balloons appearing is:
(a random double precision number between 0 and 2)/speed
Stage 2(10 marks)-
If the player clicks a point inside a balloon, it should pop.
When a balloon pops, the balloon should disappear and an animation lasting 0.2 seconds should start showing an expanding circle starting at the radius of the balloon.
When a balloon is popped, the pop.wav sound should be played (available as a download in this test). Download audio here
If the player clicks a point inside more than one balloon, they should all pop.
If two balloons are touching, when one of them is popped, they both pop (this is recursive so all balloons touching a popped balloon and balloons touching them will pop).
Subsequent pops can either start immediately or can start after the animation has played.
Stage 3(10 marks)-
The time since the start of the game and the score are displayed on the screen, top left.
The time should have 2 decimal places.
The score starts at 100.
When a green balloon is popped, the score increases by 10, when a red balloon is popped the score decreases by 50. When a green balloon goes off the bottom of the screen without being popped the score decreases by 10.
If the score goes below 0 the game is over.
When the game is over, the time should be displayed with a message saying GAME OVER! and Press Space to Restart
The user can restart the game by pressing the space bar.

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

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions