This assignment is due by Tuesday, June 18, 2019, 11:59 PM.
As with all assignments, this must be an individual effort and cannot be pair programmed. Any debugging assistance must be provided in accordance with the course collaboration policy.
Do not forget to complete the following labs with this set: L8A,
L8B,
L8C,
L8D,
L8E,
L8F,
L8G
.
· Instructions · Rubric · Submission ·
The Purpose
The Goal
We want to replace our single
Bubble
object with a
vector
of
Bubble
s. Before your draw loop, create a vector of five Bubbles. Give each
Bubble a random starting position between 100 and 400 for X and Y and a
random direction between 0.0 and 2.5 (think how to do this with
rand()
to get a range within a double value. We don't want the values to be 0,
1, 2. It should be possible for 0.7 or 1.3 or 2.4 to be the random
value set). Additionally, give each Bubble a random radius between 10
and 50. Lastly, give each Bubble a random color so we can tell them
apart.Inside our draw loop, we now need to draw all the Bubbles in our vector. After our event handling, we'll then need to update the positions of all the Bubbles in our vector. You should now see five Bubbles bouncing around the window. Excellent. Let's have the user interact.
When the user clicks the left mouse button, we want to create a new Bubble at the location where the user clicked. This new Bubble should have the same starting properties that our original five Bubbles did. After the user clicks the first time, we should see six Bubbles moving around the window. A second click, seven Bubbles. And so forth as the user continues to click. (Hmm, how can we keep track of these new Bubbles?)
We may get to the point where there are too many Bubbles on the screen. If the user presses the 'd' or 'D' key, then we want to delete the last Bubble that was added to the window. Obviously if there are no Bubbles in the window, then pressing 'd' should do nothing.
If the user starts your program, clicks twice, then presses 'd' three times, we should be seeing four Bubbles on the screen.
Grading Rubric
Your submission will be graded according to the following rubric.
Points | Requirement Description |
14 | All labs completed and submitted. |
10 | Set of Bubbles bounce around the screen. |
5 | User can add/remove Bubbles. |
5 | Bubble class created correctly. |
3 | (1) Comments used (2) Coding style followed (3) Appropriate variable names, constants, and data types used (4) Instructions followed |
37 | Total Points |
This assignment is due by Tuesday, June 18, 2019, 11:59 PM.
As with all assignments, this must be an individual effort and cannot be pair programmed. Any debugging assistance must be provided in accordance with the course collaboration policy.
Do not forget to complete the following labs with this set: L8A,
L8B,
L8C,
L8D,
L8E,
L8F,
L8G
.
Submission
Always, always, ALWAYS update the header comments at the top of your main.cpp file. And if you ever get stuck, remember that there is LOTS of help available. The following instructions are copied from How to Submit Homework.
Submission Instructions
- File and folder names are extremely important in this process.
Please double-check carefully, to ensure things are named correctly.
- The top-level folder of your project must be named
Set8
- Inside
Set8
, create 8 sub-folders that are required for this Set. The name of each sub-folder is defined in that Set (e.g.L8A
,L8B
,L8C
,L8D
,L8E
,L8F
,L8G
, andA8
). - Copy your
main.cpp
, additional header & source files () plus the
CMakeLists.txt
file into the subdirectories ofSet8
(steps 1-2), zip thisSet8
folder (steps 3-4), and then submit the zipped file (steps 5-11) to Canvas. - For example, when you zip/submit
Set8
, there will be 8 sub-folders calledL8A
,L8B
,L8C
,L8D
,L8E
,L8F
,L8G
, andA8
inside theSet8
folder, and each of these sub-folders will have a file calledmain.cpp
, additional header & source files, plus the CMakeLists.txt file .
- The top-level folder of your project must be named
- Using Windows Explorer (not to be confused with Internet Explorer), find the file
named
"main.cpp"
located inside the folder for the particular lab or homework assignment you will submit.
STOP: Are you really sure you are viewing the correct assignment's folder?
- Now, for A8, right click on the
main.cpp
to copy the file. Then, return to theSet8/A8
folder and right click to paste the file. In other words, put a copy of your homework'smain.cpp
source code into theSet8/A8
folder. Repeat this for each additional header & source file you have with this assignment, plus CMakeLists.txt.
Follow the same steps for L8A, to put a copy of your lab'smain.cpp
into theSet8/L8A
folder. Repeat this process forSet8/L8B
,Set8/L8C
,Set8/L8D
,Set8/L8E
,Set8/L8F
,Set8/L8G
.
STOP: Are you sure yourSet8
folder now has all your code to submit?
- Now, right-click on the
"Set8"
folder.- In the pop-up menu that opens, move the mouse
"Send to..."
and expand the sub-menu. - In the sub-menu that opens, select
"Compressed (zipped) folder"
.
STOP: Are you really sure you are zipping aSet8
folder with sub-folders that each contain amain.cpp
file in it?
- In the pop-up menu that opens, move the mouse
- After the previous step, you should now see a
"Set8.zip"
file.
- Now visit the Canvas page for this course
and click the
"Assignments"
button in the sidebar.
- Find Set8, click on it, find the
"Submit Assignment"
area, and then click the"Choose File"
button.
- Find the
"Set8.zip"
file created earlier and click the"Open"
button.
STOP: Are you really sure you are selecting the right homework assignment? Are you double-sure?
- WAIT! There's one more super-important step. Click on the blue
"Submit Assignment"
button to submit your homework.
- No, really, make sure you click the
"Submit Assignment"
button to actually submit your homework. Clicking the"Choose File"
button in the previous step kind of makes it feel like you're done, but you must click the Submit button as well! And you must allow the file time to upload before you turn off your computer!
- Canvas should say "Submitted!". Click "Submission Details" and you can download the zip file you just submitted. In other words, verify you submitted what you think you submitted!
"Set8"
folder
and only the "Set8"
folder, this zip folder must have several sub-folders, you must name all these folders correctly, you must submit the correct zip file for this
homework, and you must click the "Submit Assignment"
button. Not doing these steps is like bringing your
homework to class but forgetting to hand it in. No concessions will be made for
incorrectly submitted work. If you incorrectly submit your homework, we will not be able to
give you full credit. And that makes us unhappy. This assignment is due by Tuesday, June 18, 2019, 11:59 PM.
As with all assignments, this must be an individual effort and cannot be pair programmed. Any debugging assistance must be provided in accordance with the course collaboration policy.
Do not forget to complete the following labs with this set: L8A,
L8B,
L8C,
L8D,
L8E,
L8F,
L8G
.