protected static void draw()
	{
		pane = (Graphics2D) buffer.getDrawGraphics();
		pane.drawImage(map, null, 0, 0);
		
		//calculates the new position for the player
		movement();
		
		player.centerx = player.x+(player.width/2);
		player.centery = player.y+(player.height/2);
		player.rotate = Math.toDegrees(Math.atan2(mousex-player.centerx, player.centery-mousey));	

		//this if statement runs when the mouse button is pressed
		if(shoot)
		{
			if(waittime>Lazer.waittime)
			{
				//makes the variable lazer into a new instance of the Lazer class
				lazer = new Lazer(mousex, mousey, player, selectedweapon);
				pane.setColor(Color.red);
				//draws the lazer
				pane.drawLine(lazer.startx, lazer.starty, lazer.endx, lazer.endy);
				waittime = 0;
			}
		}
		
		//updates all of the zombies in the zombies arraylist
		updatezombies();

		//updates the player
		player.update();
		
		//draws the player
     	pane.drawImage(rotateImage(player.rotate, playerimg), player.x, player.y, null);
     	
     	//draws the accuracy box around the cursor
		pane.setColor(Color.red);
		int xchange = player.centerx - mousex;
		int ychange = player.centery - mousey;
		double distance = Math.sqrt(Math.pow(Math.abs(xchange), 2.0)+Math.pow(Math.abs(ychange), 2.0));
		int size = (((int) distance/Lazer.getaccuracy(selectedweapon))+1)*2;
		pane.drawRect(mousex-(size/2), mousey-(size/2), size, size);
		
     	updateGUI();
 
     	//disposes of pane since it is not needed anymore
     	pane.dispose();

     	//shows the back buffer and makes the front buffer the back buffer
     	buffer.show();
  		
     	//basically disposes the instance of the Lazer class
		lazer = null;
	}