WARNING: this project should be run on Google Chrome. Other browsers such as Firefox and Safari have different frame rates, which can affect the final values. Click the green flag to run the simulation. Click the switch at the bottom left to change between skid marks and a dot diagram. Click the green flag at the top left to rerun the program. When set to dot diagram, white dots indicate constant velocity; red dots indicate changing velocity. A dot is drawn every three script cycles using a modulo operation; without this, dots can overlap and are difficult to distinguish. Note: code is immediately stopped on collision. Variables (units in parentheses): - xVelocity (px/cycle): pixels traveled per script cycle - xAcceleration (px/cycle/cycle or px/cycle^2): change of xVelocity per script cycle - skidLength (px): length of skid marks from tires - time (s): time since brakes were applied - xVelocityReal (m/s) - xAccelerationReal (m/s/s or m/s^2) - skidLengthReal (m) "Real" variables are converted from the original variables on the left into real-world values based on the following information: 10 pixels = 1 meter ~30.5 script cycles = 1 second All code and art are my own work (except for the speed limit sign, which is from Google Images).