 			segment:Segment,
 			sprite:BitmapData;
 
-			for (i = 0; i < _totalCars; i++)
+			for (i = 0; i < _opponentsTotal; i++)
 			{
 				offset = Math.random() * randomChoice([-0.8, 0.8]);
 				z = int(Math.random() * _segments.length) * _segmentLength;

			switch (key)
			{
				case "u":
					_isAccelerate = true;
					break;
				case "d":
					_isBrake = true;
					break;
				case "l":
					_isSteerLeft = true;
					break;
				case "r":
					_isSteerRight = true;
					break;
			}
		}

		private var _bgLayers:Vector.<ParallaxLayer>;
		
		private var _sprites:Sprites;
		private var _segments:Vector.<Segment>;	// array of road segments
		private var _opponents:Vector.<Car>;	// array of cars on the road
		
		private var _width:int;
		private var _height:int;
		private var _widthHalf:int;
		private var _heightHalf:int;
		
		private var _dt:Number;					// how long is each frame (in seconds)
		private var _resolution:Number;			// scaling factor to provide resolution independence (computed)
		private var _drawDistance:int;			// number of segments to draw
		private var _hazeDensity:int;			// exponential haze density
		private var _hazeColor:uint;
		
		private var _cameraHeight:Number;		// z height of camera (500 - 5000)
		private var _cameraDepth:Number;		// z distance camera is from screen (computed)
		private var _fieldOfView:int;			// angle (degrees) for field of view (80 - 140)
		private var _bgSpeedMult:Number;
		
		private var _roadWidth:int;				// actually half the roads width, easier math if the road spans from -roadWidth to +roadWidth
		private var _segmentLength:int;			// length of a single segment
		private var _rumbleLength:int;			// number of segments per red/white rumble strip
		private var _trackLength:int;			// z length of entire track (computed)
		private var _lanes:int;					// number of lanes
		private var _opponentsTotal:int;		// total number of cars on the road
		
		private var _acceleration:Number;		// acceleration rate - tuned until it 'felt' right
		private var _deceleration:Number;		// 'natural' deceleration rate when neither accelerating, nor braking
		private var _braking:Number;			// deceleration rate when braking
		private var _offRoadDecel:Number;		// speed multiplier when off road (e.g. you lose 2% speed each update frame)
		private var _offRoadLimit:Number;		// limit when off road deceleration no longer applies (e.g. you can always go at least this speed even when off road)
		private var _centrifugal:Number;		// centrifugal force multiplier when going around curves
		
		private var _playerX:Number;			// player x offset from center of road (-1 to 1 to stay independent of roadWidth)
		private var _playerY:int;				// player x offset from center of road (-1 to 1 to stay independent of roadWidth)
		private var _playerZ:Number;			// player relative z distance from camera (computed)
		
		private var _position:Number;			// current camera Z position (add playerZ to get player's absolute Z position)
		private var _speed:Number;				// current speed
		private var _maxSpeed:Number;			// top speed (ensure we can't move more than 1 segment in a single frame to make collision detection easier)
		
		private var _currentLapTime:Number;		// current lap time
		private var _lastLapTime:Number;		// last lap time
		private var _fastestLapTime:Number;
		
		private var _isAccelerating:Boolean;
		private var _isBraking:Boolean;
		private var _isSteeringLeft:Boolean;
		private var _isSteeringRight:Boolean;
		
		
		// -----------------------------------------------------------------------------------------
