public void update(int zombienum)
	{
		centerx = x+(width/2);
		centery = y+(height/2);
		
		
		if(centery > Main.player.centery)
			y -= speed;
		if(centery < Main.player.centery)
			y += speed;
		if(centerx > Main.player.centerx)
			x -= speed;
		if(centerx < Main.player.centerx)
			x += speed;
		
		
		rotate = Math.toDegrees(Math.atan2(Main.player.centerx-centerx, centery-Main.player.centery));	
		previousx = x;
		previousy = y;
		
		//x = (int) (((speed)*Math.cos(rotate)) + x);
		//y = (int) (((speed)*Math.sin(rotate)) + y);

		rect.setRect(x, y, width, height);
		
		Main.pane.setColor(Color.green);
		Main.pane.drawString("health: "+health,x, y);
		
		
		if(Main.lazer != null)
			if(rect.intersectsLine(Main.lazer.startx, Main.lazer.starty, Main.lazer.endx, Main.lazer.endy))
			{
				previoushealth = health;
				health -= Main.lazer.damage;
			}					
		if(health <= 0)
		{
			Main.zombies.remove(zombienum);
			Main.numOFzombieskilled++;
			Main.numOFzombiesonfield--;
			Main.numOFzombiesUNTILwitch--;
		}
	}