@Override
	public void update(int tick) {
		target = getTargetVector();
		
		if (onFire && tick % 3 == 0) frame = (frame + 1) % 4;
		
		Vector dif = target.clone().sub(pos);
		if (dif.getLength() > speed) dif.setLength(speed);
		
		angle = (float) Math.atan2(dif.y, dif.x);
		
		pos.add(dif);
		
		if (canSetOnFire && !onFire) {
			for (Entity e : Game.world.entities) {
				if (e instanceof Torch) {
					if (((Torch) e).getAttackArea().contains(pos.x, pos.y)) {
						onFire = true;
						break;
					}
				}
			}
		}
		
		if (pos.equals(target)) {
			onImpact();
			dead = true;
		}
	}