 				spriteX:Number,
 				spriteY:Number;
 			
+			_playerY = interpolate(playerSegment.p1.world.y, playerSegment.p2.world.y, playerPercent);
+			
 			_renderBuffer.clear();
 			
-			/* Render background layers. */
-			_bgLayer1.offsetFactorX = _skyOffset;
-			_bgLayer1.offsetFactorY = _resolution * _bgSpeedMult * playerY;
-			_bgLayer2.offsetFactorX = _hillOffset;
-			_bgLayer3.offsetFactorX = _treeOffset;
-			
+			/* Update background layers and blit them to render buffer. */
 			_bgScroller.update();
 			_renderBuffer.blitImage(_bgScroller, 0, 0, _bgScroller.width, _bgScroller.height);
 			

		 */
		protected function setup():void
		{
			_renderBuffer = new SoftwareRenderBuffer(_width, _height, false, 0xFF00FF);
			_bufferBitmap = new Bitmap(_renderBuffer);
			_bgScroller = new ParallaxScroller(_width, _sprites.BG_SKY.height, bgLayers);

		private var _bgLayers:Vector.<ParallaxLayer>;
		
		private var _sprites:Sprites;
		private var _segments:Vector.<Segment>;			// array of road segments
		private var _cars: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 = 1000;	// z height of camera (500 - 5000)
		private var _cameraDepth:Number;			// z distance camera is from screen (computed)
		private var _fieldOfView:int = 100;			// angle (degrees) for field of view (80 - 140)
		private var _bgSpeedMult:Number = 0.001;
		
		private var _playerX:Number = 0;			// 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 _roadWidth:int = 2000;			// actually half the roads width, easier math if the road spans from -roadWidth to +roadWidth
		private var _segmentLength:int = 200;		// length of a single segment
		private var _rumbleLength:int = 3;			// number of segments per red/white rumble strip
		private var _trackLength:int = 200;			// z length of entire track (computed)
		private var _lanes:int = 3;					// number of lanes
		private var _totalCars:Number = 200;		// total number of cars on the road
		
		private var _accel:Number;					// acceleration rate - tuned until it 'felt' right
		private var _breaking:Number;				// deceleration rate when braking
		private var _decel:Number;					// 'natural' deceleration rate when neither accelerating, nor braking
		private var _offRoadDecel:Number = 0.99;	// 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 = 0.3;		// centrifugal force multiplier when going around curves
		
		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 = 0;		// current lap time
		private var _lastLapTime:Number = 0;		// last lap time
		private var _fast_lap_time:Number;
		
		private var _isAccelerate:Boolean;
		private var _isBrake:Boolean;
		private var _isSteerLeft:Boolean;
		private var _isSteerRight:Boolean;
		
		
		// -----------------------------------------------------------------------------------------
		// Signals
		// -----------------------------------------------------------------------------------------
