public void update(){
		
//		if(shooting){
//			if(!audioPlayed){
//				audio = new JukeBox("scifi003.mp3");
//				audio.play();
//				audioPlayed= true;
//			}
//		}
//		if(!shooting){
//			audioPlayed = false;
//		}
//		
		
		laserTimer++;
		
		if(health <=0){
			dead = true;
		}
		
		if(shooting){
			if(laserTimer == 100){
				laserFire();
			}
		}
		if(laserTimer == 400){
			laserTimer = 0;
		}
		
		if(falling){
			y+=2;
		}
		if(bottomMapCollision){
			y+=0;
		}
		
		if(idle){
			shooting = false;
			walking = false;
			x+=0;
			x-=0;
			y+=0;
		}
		
		if((x - player.x) > 0){
			setFacingRight(false);
			
		}
		if((x - player.x) < 0){
			setFacingRight(true);
		}
		

		
		if(((Math.abs((x+40) - player.x) <= 450) && (Math.abs(y - player.y) <=750)) && !shooting){
			idle = false;
			walking = true;
			
			if(facingRight){
				if(Math.abs(x - player.x) <=150){
					x+=0;
					walking = false;
				}
				else if(x <= 470){
					x+=2;
				}
			}
			else if(!facingRight){
				if(Math.abs(x - player.x) <=150){
					x-=0;
					walking = false;
				}
				else if(x >= 300){
				x-=2;
				}
			}
		
		}
		else if((Math.abs(x - player.x) >250)){
			idle = true;
			walking = false;
		}

		
		if(Math.abs((x+40) - player.x) <=250 && (Math.abs(y - player.y) <=90)){
			x+=0;
			x-=0;
			shooting = true;
			idle = false;
			walking = false;
			
		}
		else{
			
			shooting = false;
		}
		
		
		
		if(flinching){
			walking = false;
			idle = false;
			
		}
		
		if(!walking && !shooting){
			idle = true;
		}
		
		
		
	}