extern void object::Move( )
{
	object	target;
	point	p;
	float	m;

	errmode(0);  // ne stoppe pas si erreur

	while ( true )
	{
		target = radar(Car);
		if ( target == null or
			 distance2d(position, target.position) > 20 )
		{
			action(0, 2);
			m = (rand()-0.5)*0.5;
			motor(m, -m);
			wait(rand()*3);
		}
		else
		{
//?			turn(direction(target.position));
			Rotate(target);
			action(6, 2);  // fire
			wait(2.5);

			if ( rand() < 0.5 )
			{
				motor(0.2, -0.2);
			}
			else
			{
				motor(-0.2, 0.2);
			}
			wait(2.5);
			motor(0, 0);
		}
	}
}

// Slow rotation.

void object::Rotate(object target)
{
	if ( direction(target.position) < 0 )
	{
		motor(0.2, -0.2);
		while ( direction(target.position) < 0 )
		{
			wait(0.1);
		}
	}
	else
	{
		motor(-0.2, 0.2);
		while ( direction(target.position) > 0 )
		{
			wait(0.1);
		}
	}
	motor(0, 0);
}
