CSCI 261 - Programming Concepts (C++)

Fall 2016 - Assignment 12 - Bubble Bobble

Quick Links: Blackboard | EECS | Mines | Piazza | zyBooks

|   Home |  Contact |  Syllabus |  Assignments |  Schedule |  Resources   |
This assignment is due by December 05, 2016 08:00am.


The Purpose



The purpose of this assignment is to give you practice animating objects and interacting with them.


The Goal



You will need to complete Lab12 before beginning this assignment.

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 apary.

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 final submission will be graded according to the following rubric.

Percentage Requirement Description
10% Lab completed
70% Set of Bubbles bounce around the screen. User can add/remove Bubbles.
20% (1) Comments used (2) Coding style followed (3) Appropriate variable names, constants, and data types used (4) Instructions followed (5) Assignment compiles


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.

In summary, for homework due on Monday, December 05 follow these specific steps:
  • create a directory called week12.
  • within week12, create two subdirectories: Lab12 and A12.
  • within your new week12/Lab12 directory, copy in your main.cpp, Bubble.h, Bubble.cpp files from your Lab12 solution.
  • within your new week12/A12 directory, copy in your main.cpp, Bubble.h, Bubble.cpp file and any other files you created/used (*.h, *.cpp) from your A12 solution.
  • compress the week12 directory (see Step 3 here for details).
  • submit the week12.zip file to Blackboard (see Steps 5-10 here for details).
  • after you submit, download the file and double check it contains all that you think it contains!

This assignment is due by December 05, 2016 08:00am.
Last Updated: 01/01/70 00:00


Valid HTML 4.01 Strict Valid CSS! Level Triple-A conformance, W3C WAI Web Content Accessibility Guidelines 2.0