public void renderScreen()
	{
		if (buffer == null)
		{  // create the buffer
			buffer = createImage(PWIDTH, PHEIGHT);
			dbg = buffer.getGraphics();
		}
		
		// Render campus
		dbg.setColor(Color.LIGHT_GRAY);
		for (int i=0; i<TILESX; i++)
			for (int j=0; j<TILESY; j++)
			{	if (tiles[i][j]!=null)
					dbg.drawImage(tiles[i][j], i*TILE, j*TILE, TILE, TILE, this);//  tiles[i][j].paintIcon(this, g, i*TILE, j*TILE);
				else
					dbg.fillRect(i*TILE, j*TILE, TILE, TILE);
			}
			
		// Render player
		dbg.drawImage(player, playerX*TILE, playerY*TILE, TILE, TILE, this); //player.paintIcon(this, g, playerX, playerY);
		
		// Render pedestrians
		try {
			for (Pedestrian p : pedestrians)
			{	if (p.hasMove())
				{	int pedX = p.getLocation().x-screenX;
					int pedY = p.getLocation().y-screenY;
					dbg.drawImage(p.getImage(), pedX*TILE, pedY*TILE, TILE, TILE, this);
				}
			}
		} catch (Exception e) {}
		
		// Arrow angle calculation
		double a = (playerY+screenY) - destination.y;
		double b = (playerX+screenX) - destination.x;
		double c = Math.pow(Math.pow(a,2) + Math.pow(b,2), .5);
		if (a <= 0)
			angle = Math.toRadians(180) + Math.asin(b/c);
		else
			angle = Math.toRadians(0) - Math.asin(b/c);
		
		// Rotate arrow image and draw
		AffineTransform tx = AffineTransform.getRotateInstance(angle, TILE/2, TILE/2);
		AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_BILINEAR);
		((Graphics2D)dbg).drawImage(op.filter(arrow, null),(PWIDTH/2 - TILE), 5, null);		// draw arrow
		
		// GUI labels
		dbg.setColor(Color.RED);
		dbg.setFont(dbg.getFont().deriveFont(14));
		dbg.drawString("Day: "+day.getDay(), 25, TILE/2);
		dbg.drawString("Class: "+day.getNextCourseName(), PWIDTH-130, TILE/2);	
	}