/**
 * @author Richard Eric M. Lope (Relminator)
 * http://rel.phatcode.net
 *
 */

package net.phatcode.rel.gameframework;


public class BehaviorDecelerated extends Behavior
{

	
	public BehaviorDecelerated()
	{
		
	}

	@Override
	public void update(Entity entity)
	{
		entity.velocity.set(entity.direction);
		entity.velocity.scale( entity.speed );
		entity.velocity.add( entity.gravity );
		entity.position.add( entity.velocity );
		if( entity.speed >= MINIMUM_SPEED )
		{
			entity.speed -= (entity.speed * FRICTION * 6);
		}
		
	}
	
	
}
