Due: Tuesday 10/22 10:00am
Submission name: w16_bounce
- Pull code from
thesource
repository.
- Copy the bounce processing program in to your work repository.
- Follow the following prompts. Place your answers at the top of your code using comments.
//
is the inline comment symbol, used to comment a single line of code.
/* */
is the block coment symbol, anything between the two asterisks will be commented out, including newlines.
- Task 0
- Read and run the program, describe, in your own words, in at most 2 sentences, generally what you see and how the program works.
- Task 1
- The program has 2 keyboard controls. explain, in your own words, what they do.
- Task 2
- Why does the program need variables for
udy
and lrx
but not corresponding variables for x and y for each distinct circle?
- Task 3
- WITHOUT ADDING ANY NEW VARIABLES, add a third circle to the program, when run, the program should behave like this:
- Task 4
- Add a 4th circle that behaves as follows:
- It should start at a random position inside the screen (but should be fully visible) and be the same size as the other circles.
- Initially, it should move one pixel down and one pixel to the left.
- When it reaches one of the screen edges, it should “bounce” in the same way that the other circles bounce.