My Python Turtle Roller Coaster

rollercoasterIn this challenge we will use Python Turtle to draw the track of a roller coaster.

We have created three procedures for you to use when drawing the track. Each procedure takes two parameters as follows:

  • straightLine(distance, speed): To draw a straight line. The distance is given as a number of pixels (e.g. 100) and the speed as a number between 1 and 6 to represent when the roller coaster is going up hill (low speed) or down hill (high speed).
  • turnLeft(angle, radius): to draw a turn / arc of a specific angle in degrees (e.g. 180 for a u-turn), and a radius to represent how sharp the turn is. (Sharp turn = low radius e.g. 10).
  • turnRight(angle, radius): Same as above but to turn to the right.

Our Roller Coaster (Overhead view)

Your Challenge

Complete the track of your own roller coaster by completing the code below, making good use of the 3 procedures straightLine(distance, speed), turnLeft(angle, radius) and turnRight(angle, radius).

Share Button
Tagged with: