public void rotateImages(float rotationAngle){
		
		//Number of right angle turns
		int numTurns = (int) Math.round(rotationAngle / (Math.PI*0.5));
		//Rounds rotationAngle to nearest integer multiple of pi/2
		float testAngle = (float) ((Math.PI*0.5)*numTurns);
		
		assert (Math.abs(testAngle-rotationAngle)<0.001): "Error! rotation angles for TileGraphics must be integer multiples of pi/2!";
		
		//pi/2 * 4 = 2 pi, i.e. no rotation. Account for remainder	
		if ((numTurns -1) % 4 == 0){ 
			/* pi/2 rotation. 
			 * x (row indices) -> (column indices)
			 * y (column indices) -> (row indices, backwards)
			 * */
			 
			Image[][] temp = new Image[numberOfYTiles][numberOfXTiles];
			for (int i = 0; i<numberOfXTiles; i++){
				for (int j = 0; j<numberOfYTiles; j++){
					temp[j][numberOfXTiles-(i+1)] = tileImages[i][j];
				}	
			}
			
			int tempY = numberOfYTiles;
			numberOfYTiles = numberOfXTiles;
			numberOfXTiles = tempY;
			
			tileImages = temp;
			
		}
		
		if ( (numTurns -2) % 4 == 0){ 
			/* pi rotation. 
			 * x (row indices) -> (row indices, backwards)
			 * y (column indices) -> (column indices, backwards)
			 * */
			
			 
			Image[][] temp = new Image[numberOfXTiles][numberOfYTiles];
			for (int i = 0; i<numberOfXTiles; i++){
				for (int j = 0; j<numberOfYTiles; j++){
					temp[numberOfXTiles-(i+1)][numberOfYTiles-(j+1)] = tileImages[i][j];
					
				}	
			}
			
			
			tileImages = temp;
			
		}
		
		if ( (numTurns -3) % 4 == 0){ 
			/* -pi/2 rotation. 
			 * x (row indices) -> (column indices, backwards)
			 * y (column indices) -> (row indices)
			 * */
			
			 
			Image[][] temp = new Image[numberOfYTiles][numberOfXTiles];
			for (int i = 0; i<numberOfXTiles; i++){
				for (int j = 0; j<numberOfYTiles; j++){
					temp[numberOfYTiles-(j+1)][i] = tileImages[i][j];
					
				}	
			}
			
			int tempY = numberOfYTiles;
			numberOfYTiles = numberOfXTiles;
			numberOfXTiles = tempY;
			
			tileImages = temp;
			
		}
		
		
	}