Customizing the Race Car

Do this on

1. For a customized game, you can add this at the beginning of your program:

wear "/img/red-car-glibersat", 50

The wear command changes the turtle's look to another image.

This image is a red car by an internet user called glibersat. The requested height is 50, and the requsted image picked by putting its addres in quotes: "/img/red-car-glibersat". Internet addresses are called URLs: every image or webpage on the internet has a URL. You can change the URL to another image. Try right-clicking on any image in your browser to find its URL. Here is one:

wear {height: 20, turtleTwist: -90},

A trick: if the image you want is the wrong size or direction, you can resize it or twist it by adding special values in curly braces as an extra input to wear.

2. For a car with customized controls, you can add code like this:

The new yellow code can be added
indented under your tick 60, -> line.
speed Infinity
tick 60, ->
  if pressed "M"  
    dot black, 30
  if pressed "up" then fd 2
  if pressed "left" then lt 1  

Use if pressed "M" to add the M key as a control. By indenting dot black, 30 under that line, we can draw an "oil slick" whenever M is pressed.

Q1: ____________________

Q2: ____________________


Challenge 1 done: ____

Challenge 2 done: ____

Challenge 3 done: ____

3. Questions and Challenges:

Question 1. By using double-slashes //, URLs can name the website with the file. From which website is the example purple car image loaded?
Question 2. What happens if you change the M control to do dot black, 300?
Challenge 1. Can you use the image /img/s/rocket-ship?
Challenge 2. Can you use an image you pick from the internet? Hint: URLs from sites outside pencilcode will start with http://
Challenge 3. Can you add a key to change the car's look during the game?