Difference between revisions of "CSC111 Final Exam 2015"
Line 22: | Line 22: | ||
==The Banner== | ==The Banner== | ||
<br /> | <br /> | ||
− | The banner at the top of the screen is an object of | + | The banner at the top of the screen is an object of a class called '''Banner''', which is given below, along with a main program that illustrates how to use it. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<br /> | <br /> | ||
::<source lang="python"> | ::<source lang="python"> | ||
Line 96: | Line 77: | ||
</source> | </source> | ||
<br /> | <br /> | ||
+ | ==Implementation== | ||
+ | <br /> | ||
+ | * You '''must''' use objects to define the cars. | ||
+ | * The number of cars used by the program is fixed and does not grow as the game evolves. In the video, the number of cars is 3, but you can use more. When a car disappears on one end of the screen it reappears on the other side, after a short delay. The delay is up to you. | ||
+ | * The frog moves up or down by a fixed amount. To make the frog move up, the user must click the mouse in the area of the window above the road. To make the frog move down, the user clicks the mouse in the area of the window below the road. | ||
+ | * The frog "dies," or loses a ''life point'' when it is run over by a car. You are free to determine the conditions for which the program will determine that the car is running over the frog. In the video the top or bottom of the frog can overlap slightly a car without triggering the program to detect an overlap. There is flexibility. | ||
+ | |||