Graphic JavaScript


Back to index
Race Cars

Your browser does not support the HTML5 canvas tag.

ASSIGNMENT:


Widen the track a little bit and add two more race cars. (Yes, it's true, they are just balls, but we'll pretend that they are cars.) Make each car a different color. Also paint a starting/finish line. When the first car crosses the starting/finish line for the fifth time stop the race. Print a message declaring the winner and make sure that the cars all remain in the same spots they were in when the first car crossed the line.