1 / 6

Boat Racing Game Challenge #2

Boat Racing Game Challenge #2. By Chris Brown Under the direction of Professor Susan Rodger Duke University, January 2013 Based off of the Boat Racing Game by Jenna Hayes. Boat Race.

lavey
Download Presentation

Boat Racing Game Challenge #2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Boat Racing GameChallenge #2 By Chris Brown Under the direction of Professor Susan Rodger Duke University, January 2013 Based off of the Boat Racing Game by Jenna Hayes

  2. Boat Race • In this challenge, you must drive the boat to travel through 10 arches in arace course in order to win the game. The faster your time, the better you will do! To make things more difficult, the arches are placed in a random position each time you run this game, so no two courses will be alike. We want you to add to this game, so that in the end you will know the average distance between arches.

  3. Challenge • For this version of the boat race world challenge, you will need to complete the “average” function to calculate the average distance that the boat travels to go through each hoop in the game, and then modify the “win” method to display the average speed to the user once they have completed the game. The program is already set up to collect the distances between each arch, you will use those to calculate the total distance between each of the arches that you must pass through.

  4. Average Distance • We want to calculate the average distance between pairs of arches. The code provides a list of this information called distances for you to use to calculate the final average. Finish distance distance distance distance distance distance distance distance distance Start

  5. world.average • You are given a list of the distances between pairs of arches and you will need to calculate the average distance between two arches (meters/arch) it took the boat to finish the game. • Hint: There are 10 total arches in the game and the boat starts a short distance before the first arch.

  6. world.win • Now, modify this method so that the text that once displayed the timer displays the average distance the boat travelled between arches. Once again, feel free to explore Alice and add other aspects to the winning screen of the game. For example, have a fish come up out of the water to congratulate you on your victory!

More Related