Reference no: EM132334550
Assignment -
INTRODUCTION - Write a Processing program that meets the following requirements of a rotating target game. A template "Assign2Template" is provided as a starting point. A sample output video is also available on iLearn.
SETUP
- Save a copy of the template zip folder "Assign2Template" in your preferred storage location.
- To unzip all the contents of the zipped folder, press and hold (or right-click) the folder, select Extract Al!, and then follow the instructions.
- You will find an "Assign2Template" sketch with six character images (mentioned in task 5) inside the folder.
- Follow further instructions mentioned under the heading "How to present your assignment".
TASK DESCRIPTIONS -
Task 1: Display Concentric Circles
Display nRings (nRings = 6 in given template) concentric circles centered at the centre of the display window where,
Diameter of the largest ring (green) is ((nRings - 0)/nRings) * 80% of the width
Diameter of the second largest ring (white) is ((nRings - 1)/nRings) * 80% of the width
Diameter of the third largest ring (green) is ((nRings - 2)/nRings) * 80% of the width
Diameter of the fourth largest ring (white) is ((nRings - 3)/nRings) * 80% of the width
Task 2: Draw Black Circle in Each Ring
Draw a black circle of diameter 20 in the middle of each ring that goes around the path of the ring as shown in the video.
A point (x, y) on the circumference of a circle centered at (cx, cy) and radius rad, at an angle of theta, is given by:
x = cx + rad * cos (theta);
y = cy + rad * sin (theta);
Task 3: Score Calculation
When you press the mouse, it detects if a certain ball has been hit, and if so, the score increases by 1 and all balls are re-initialised. The score should be display at the top right side of the display window as shown in the sample video.
The built-in function dist (x1, y1, x2, y2) gives you the distance between points (x1, y1) and (x2, y2). To determine if the mouse is pressed inside a circle, you can check if distance between the mouse location and the circle's centre is less than or equal to the radius of the circle.
Task 4: Time Calculation
You should apply a time limit such as 20 seconds to the game. The number of seconds left should be displayed along with the score on the top right side of the display window. The game goes on as long as the time left is more than 0.
HINT: The built-in function minis° gives you the number of milliseconds past since the beginning of the program.
Task 5: High Distinction Component
Instead of just black circles, specific characters should go around the rings, either clockwise, or anti- clockwise. Each character has a corresponding image, provided for you in the template.