public void update(){
		if(lastX == x && lastY == y) moving = false;
		lastX = x;
		lastY = y;
		
		if(attackTime > 0){
			attackTime--;
			weaponFrame++;
			speed = speed / 2;
		}
		
		if(pathfinder.line(x + 16, y + 16, dungeon.getPlayer().getX() + 16, dungeon.getPlayer().getY() + 16)){
			canSeePlayer = false;
			target = null;
		}
		else{
			canSeePlayer = true;
			target = dungeon.getPlayer();
		}
		
		
		if(target == null){
			wanderSpawner();
		}else{
			pathTo(new Vector2i(x / 32, y / 32), new Vector2i(target.getX() / 32, target.getY() / 32), 0);
//			if(attackTime == 0){
//				attDir = -1;
//				weaponFrame = 0;
//			}
//			
//			if(attackTime == 0){
//				attDir = dir;
//			}
//			
//			if(attackTime == 10){
//				attack(attDir, random.nextInt(5));
//			}
		
		
		}
		animation();
		calculateBobbing();

		if(knockback > 0.0f) calculateKnockback();
		if(attackTime > 0) attackTime--;

		time++;
		tileX = (x + 16) / 32;
		tileY = (y + 16) / 32;

	}