package com.badlogic.gdx.artemis.components;

import com.artemis.Component;
import com.artemis.ComponentType;
import com.badlogic.gdx.math.Vector2;

public class Path extends Component {
	public static ComponentType CType = ComponentType.getTypeFor(Path.class);
	
	public com.badlogic.gdx.math.Path<Vector2> path;
	public float timer;
	public final float duration;
	
	public Loop loop;
	public boolean reverse;
	
	private boolean done;
	
	/**
	 * @param path - path for the entity to follow
	 * @param duration - time it should take to traverse the path
	 */
	public Path(com.badlogic.gdx.math.Path<Vector2> path, float duration) {
		this.path = path;
		this.duration = duration;
	}
	
	public void update(float t)
	{
		if (done)
			return;
		
		timer += t;
		if (timer >= duration)
		{
			switch(loop)
			{
				case Repeat:
					timer = 0f;
					break;
				case PingPong:
					reverse = !reverse;
					timer = 0;
					break;
				default:
					done = true;
					break;
			}
		}
	}
	
	public void getValue(Vector2 out)
	{
		if (!reverse)
		{
			path.valueAt(out, timer / duration);
		}
		else
		{
			path.valueAt(out, (duration - timer) / duration);
		}
	}
	
	public static enum Loop {
		None,
		Repeat,
		PingPong;
	}
}

@@ -674,24 +674,403 @@
 ation;%0A%09%7D%0A%09%0A
+%09/**%0A%09 * @param path - path for the entity to follow%0A%09 * @param duration - time it should take to traverse the path%0A%09 * @param delay - how long it should take before the entity will start traversing the path%0A%09 */%0A%09public Path(com.badlogic.gdx.math.Path%3CVector2%3E path, float duration, float delay) %7B%0A%09%09this.path = path;%0A%09%09this.duration = duration;%0A%09%09this.timer = -delay;%0A%09%7D%0A%09%0A%09%0A%09%0A
 %09public void
@@ -1388,24 +1388,69 @@
 or2 out)%0A%09%7B%0A
+%09%09if (timer %3C 0)%0A%09%09%09path.valueAt(out, 0);%0A%09%09%0A
 %09%09if (!rever

Add a path follower component that goes along a Path<T> object of libGdx