Assignment 6-WPF BB revisited

advertisement
WPF Project – Bouncing balls revisited
Create a WPF program that:
1. Has 2 option dialog boxes
a. Size of ball (initial value is 1)
b. Initial direction of ball in degrees (initial value is 45)
2. Has a button labeled: play, which, when clicked:
a. Values are validated
b. Creates a movable ball
c. The ball starts moving in specified direction
d. Allows “play” to be clicked AGAIN, thus creating a 2nd ball
3. No limit to # of balls
4. Balls are allowed to intersect and bounce off each other
5. Collision rules (balls and walls)
a. Compute angle of incidence
b. Compute angle of reflection
c. Set ball movement in direction of computed reflection
d. Balls do not “wrap” around through hyperspace to the opposite edge
6. The window must be movable and resizable without erasing the balls
7. Balls do not intersect with the buttons
Download