Assignment: Race Track

Introduction

Create an application that simulates a race track with multiple cars. The program should start all cars at the starting line. When the user clicks the Go button, they should begin moving randomly, racing side by side. When the first car reaches the finish line, the program should indicate which car won and stop the cars where they are. The user may then click the Reset button to return the cars to their starting positions.

Important features

  • Simulate car race with at least 4 cars
  • Control array of images (cars) and labels (numbers)
  • Random numbers initialized when program begins
  • The number of the winning car lights up and cars stop when a car wins
  • Go button enables timer and disables itself
  • Timer runs every 50ms and moves each car a random distance, using a For…Next loop
  • Reset button stops timer and returns cars to starting line, then enables Go and gives it the focus
  • When a car “wins”, its number changes color and a bell is sounded (Beep command)
  • Default and Cancel properties
  • Proper indents, spacing, comments

Example

Resources

You may use the same car (below) or choose your own graphics.

Extra Credit

If your program makes “smooth motion” through the use of changing acceleration instead of directly changing the velocity of each car, you will receive extra credit.