package net.phatcode.rel;


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);
		}
		
	}
	
	
}
