private void updateLasers(){
    	Iterator l = map.getLasers();
    	Laser laser;
    	Object player;
    	double x1, y1, x2, y2;
    	while(l.hasNext()){
    		laser = (Laser)l.next();
    		player = laser.getParent();
    		if(player instanceof Ship){
    			//moves the players laser with reguards to his/her mouse.
    			x1 = (float)((Ship)player).getNose().noseX;
        		y1 = (float)((Ship)player).getNose().noseY;
        		double mouseX = inputManager.getMouseX();
        		double mouseY = inputManager.getMouseY();
        		x2 = ((Ship)player).getX()-(screen.getWidth()/2-mouseX)+(32);
    			y2 = ((Ship)player).getY()-(screen.getHeight()/2-mouseY)+(32);
    			
    			//remove x totalPower from parent ship for each second
    			//the laser has been going, where x is the current power of the laser.
    			double elapsedLaserTime = System.currentTimeMillis() - laser.getLastUpdate();
    			double powerDiff = Laser.getPowerDifference(laser, elapsedLaserTime);
    			
    			double newTotalPower = ((Ship)player).getTotalPower()-powerDiff;
    			if(newTotalPower <3 )newTotalPower = 3;
    			((Ship)player).setTotalPower(newTotalPower);
    					
    		}else{
    			Object target = ((Turret)player).getTarget();
    			if(target instanceof Ship){
    				Ship s = (Ship)target;
    				x2 = s.getX()+s.getWidth()/2;
    				y2 = s.getY()+s.getHeight()/2;
    			}else{
    				Sprite p = (Sprite)target;
    				x2 = p.getX()+p.getWidth()/2;
    				y2 = p.getY()+p.getHeight()/2;
    			}
    			x1 = (float)((Turret)player).getX();
    			y1 = (float)((Turret)player).getY();
    		}
    		laser.setLastUpdate(System.currentTimeMillis());
    		laser.getLine().setLine(x1, y1, x2, y2);
    		checkLaserCollisions(laser);
    		
    	}
    }