public Traffic(int yStartingPos){
	speed = (int)(Math.random() * 9 + 5);
	
	this.yStartingPos = yStartingPos;
	//randomly assign colours to each new car generated
	r = (int)(Math.random() * 255 + 1);
	g = (int)(Math.random() * 255 + 1);
	b = (int)(Math.random() * 255 + 1);		
	trafficColor = new Color(r,g,b);	
	
	r2 = (int)(Math.random() * 255 + 1);
	g2= (int)(Math.random() * 255 + 1);
	b2 = (int)(Math.random() * 255 + 1);
	roofColor = new Color(r2,g2,b2);	
	
	width = FrogsterConstants.TRAFFIC_WIDTH;
	height = FrogsterConstants.TRAFFIC_HEIGHT;
	
	if(yStartingPos == 1){
		y = 310;
		x = 0;
	}else if(yStartingPos == 2){
		y = 520;
		x = FrogsterConstants.JPANEL_SIZE - width;
	}else if(yStartingPos == 3){
		y = 450;
		x = 0;
	}else{
		y = 380;
		x = FrogsterConstants.JPANEL_SIZE - width;
	}
		
	
	trafficRectangle = new Rectangle(x,y,width,height);			
		
	}