2012-12-29 10:30:42 +00:00
|
|
|
extern void object::Activity( )
|
|
|
|
{
|
|
|
|
float d1, d2;
|
|
|
|
|
|
|
|
errmode(0); // ne stoppe pas si erreur
|
|
|
|
|
|
|
|
while ( true )
|
|
|
|
{
|
|
|
|
d1 = 2+rand()*2;
|
|
|
|
d2 = 1+rand()*3;
|
|
|
|
|
|
|
|
turn(-50);
|
|
|
|
turn(110);
|
|
|
|
turn(30);
|
|
|
|
move(d1);
|
|
|
|
wait(0.5);
|
|
|
|
turn(-90);
|
|
|
|
if ( rand() < 0.5 )
|
|
|
|
{
|
|
|
|
wait(2+rand()*2);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
turn(-60);
|
|
|
|
turn(110);
|
|
|
|
turn(-50);
|
|
|
|
}
|
|
|
|
turn(-90);
|
|
|
|
move(d1+d2);
|
|
|
|
wait(0.5);
|
|
|
|
turn(90);
|
|
|
|
if ( rand() < 0.5 )
|
|
|
|
{
|
|
|
|
wait(2+rand()*2);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
turn(-30);
|
|
|
|
turn(60);
|
|
|
|
turn(-30);
|
|
|
|
}
|
|
|
|
turn(90);
|
|
|
|
move(d2);
|
|
|
|
wait(0.5);
|
|
|
|
turn(-90);
|
|
|
|
}
|
|
|
|
}
|