Convert all text files to Unicode
parent
e91c5bc2ad
commit
7ed8a2ba67
|
@ -80,7 +80,7 @@ extern void object::Attack( )
|
|||
}
|
||||
}
|
||||
|
||||
// Calcule la distance jusqu'à la base.
|
||||
// Calcule la distance jusqu'à la base.
|
||||
|
||||
float object::RetBaseDistance()
|
||||
{
|
||||
|
|
|
@ -78,7 +78,7 @@ extern void object::Attack( )
|
|||
}
|
||||
}
|
||||
|
||||
// Calcule la distance jusqu'à la base.
|
||||
// Calcule la distance jusqu'à la base.
|
||||
|
||||
float object::RetBaseDistance()
|
||||
{
|
||||
|
|
|
@ -80,7 +80,7 @@ extern void object::Attack( )
|
|||
}
|
||||
}
|
||||
|
||||
// Calcule la distance jusqu'à la base.
|
||||
// Calcule la distance jusqu'à la base.
|
||||
|
||||
float object::RetBaseDistance()
|
||||
{
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
extern void object::Attack( )
|
||||
{
|
||||
int list[], i; // liste des objets cherchés
|
||||
int list[], i; // liste des objets cherchés
|
||||
object target; // info sur la cible
|
||||
point lastPos; // dernière position (pr test si bloquée)
|
||||
point lastPos; // dernière position (pr test si bloquée)
|
||||
float distTar; // distance de la cible
|
||||
float dirTar; // direction de la cible
|
||||
float r; // valeur aléatoire
|
||||
float r; // valeur aléatoire
|
||||
float mp; // puissance moteur
|
||||
float tangle; // angle d'esquive en cas d'eau
|
||||
boolean ifmove; // si on avance en tirant ou pas
|
||||
|
@ -52,7 +52,7 @@ extern void object::Attack( )
|
|||
wait(cmdline(0)); // attend pour entrer en action
|
||||
lastPos = position; // initialise
|
||||
ifmove = true;
|
||||
while ( true ) // répète à l'infini
|
||||
while ( true ) // répète à l'infini
|
||||
{
|
||||
target = radar(list);
|
||||
dirTar = direction(target.position);
|
||||
|
@ -82,7 +82,7 @@ extern void object::Attack( )
|
|||
{
|
||||
ifmove = true;
|
||||
if (distance(lastPos, position) < 0.2)
|
||||
{ //si elle est bloquée par obstacle
|
||||
{ //si elle est bloquée par obstacle
|
||||
lastPos = position;
|
||||
turn(rand()*360-180);
|
||||
motor(1,1);
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
extern void object::Attack( )
|
||||
{
|
||||
int list[], i; // liste des objets cherchés
|
||||
int list[], i; // liste des objets cherchés
|
||||
object target; // info sur la cible
|
||||
point lastPos; // dernière position (pr test si bloquée)
|
||||
point lastPos; // dernière position (pr test si bloquée)
|
||||
float distTar; // distance de la cible
|
||||
float dirTar; // direction de la cible
|
||||
float r; // valeur aléatoire
|
||||
float r; // valeur aléatoire
|
||||
float mp; // puissance moteur
|
||||
float tangle; // angle d'esquive en cas d'eau
|
||||
boolean ifmove; // si on avance en tirant ou pas
|
||||
|
@ -52,7 +52,7 @@ extern void object::Attack( )
|
|||
wait(cmdline(0)); // attend pour entrer en action
|
||||
lastPos = position; // initialise
|
||||
ifmove = true;
|
||||
while ( true ) // répète à l'infini
|
||||
while ( true ) // répète à l'infini
|
||||
{
|
||||
target = radar(list);
|
||||
dirTar = direction(target.position);
|
||||
|
@ -82,7 +82,7 @@ extern void object::Attack( )
|
|||
{
|
||||
ifmove = true;
|
||||
if (distance(lastPos, position) < 0.2)
|
||||
{ //si elle est bloquée par obstacle
|
||||
{ //si elle est bloquée par obstacle
|
||||
lastPos = position;
|
||||
turn(rand()*360-180);
|
||||
motor(1,1);
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
extern void object::Attack( )
|
||||
{
|
||||
int list[], i; // liste des objets cherchés
|
||||
int list[], i; // liste des objets cherchés
|
||||
object target; // info sur la cible
|
||||
point lastPos; // dernière position (pr test si bloquée)
|
||||
point lastPos; // dernière position (pr test si bloquée)
|
||||
float distTar; // distance de la cible
|
||||
float dirTar; // direction de la cible
|
||||
float r; // valeur aléatoire
|
||||
float r; // valeur aléatoire
|
||||
float mp; // puissance moteur
|
||||
float tangle; // angle d'esquive en cas d'eau
|
||||
boolean ifmove; // si on avance en tirant ou pas
|
||||
|
@ -52,7 +52,7 @@ extern void object::Attack( )
|
|||
// wait(cmdline(0)); // attend pour entrer en action
|
||||
lastPos = position; // initialise
|
||||
ifmove = true;
|
||||
while ( true ) // répète à l'infini
|
||||
while ( true ) // répète à l'infini
|
||||
{
|
||||
target = radar(list);
|
||||
dirTar = direction(target.position);
|
||||
|
@ -82,7 +82,7 @@ extern void object::Attack( )
|
|||
{
|
||||
ifmove = true;
|
||||
if (distance(lastPos, position) < 0.2)
|
||||
{ //si elle est bloquée par obstacle
|
||||
{ //si elle est bloquée par obstacle
|
||||
lastPos = position;
|
||||
turn(rand()*360-180);
|
||||
motor(1,1);
|
||||
|
|
32
ai/antec.txt
32
ai/antec.txt
|
@ -1,12 +1,12 @@
|
|||
extern void object::Attack( )
|
||||
{
|
||||
int list[], i; // liste des objets cherchés
|
||||
int list[], i; // liste des objets cherchés
|
||||
object target; // info sur la cible
|
||||
point center; // coordonnées du centre de la zone
|
||||
point lastPos; // dernière position (pr test si bloquée)
|
||||
point center; // coordonnées du centre de la zone
|
||||
point lastPos; // dernière position (pr test si bloquée)
|
||||
float distCent; // rayon de la zone
|
||||
float distLim; // rayon à ne pas dépasser
|
||||
float r; // valeur aléatoire
|
||||
float distLim; // rayon à ne pas dépasser
|
||||
float r; // valeur aléatoire
|
||||
|
||||
errmode(0); // ne stoppe pas si erreur
|
||||
while ( ismovie() != 0 ) wait(1);
|
||||
|
@ -35,28 +35,28 @@ extern void object::Attack( )
|
|||
list[i++] = Subber;
|
||||
list[i++] = Me;
|
||||
|
||||
center.x = cmdline(0); // prend les coordonnée
|
||||
center.x = cmdline(0); // prend les coordonnée
|
||||
center.y = cmdline(1); // du centre de la zone
|
||||
center.z = 0; // à exclure
|
||||
center.z = 0; // à exclure
|
||||
distCent = cmdline(2); // rayon de la zone
|
||||
distLim = cmdline(3);
|
||||
|
||||
lastPos = position; // initialise
|
||||
turn(rand()*360-180);
|
||||
motor(1,1); // en avant toute
|
||||
while ( true ) // répère à l'infini
|
||||
while ( true ) // répère à l'infini
|
||||
{
|
||||
target = radar(list, 0, 360, 0, 40);
|
||||
if (target == null or topo(position)<0)// pas de cible à proximité
|
||||
if (target == null or topo(position)<0)// pas de cible à proximité
|
||||
{ // ou pieds dans l'eau
|
||||
if (distance2d(position, center) < distCent
|
||||
or distance2d(position, center) > distLim
|
||||
or topo(position)<0)
|
||||
{ // si la fourmi est dans la zone interdite
|
||||
motor(0, 0); //s'arrête
|
||||
wait(0.5); //marque un arrêt
|
||||
motor(0, 0); //s'arrête
|
||||
wait(0.5); //marque un arrêt
|
||||
motor (-0.5, -0.5);//recule lentement
|
||||
wait (1.5); //attend qu'ait reculé
|
||||
wait (1.5); //attend qu'ait reculé
|
||||
if (distance2d(position, center) < distCent+20)
|
||||
{ //si trop proche du centre
|
||||
if (direction(center)>0) turn(direction(center)-180); else turn(direction(center)+180);
|
||||
|
@ -81,7 +81,7 @@ extern void object::Attack( )
|
|||
else
|
||||
{ //si elle est bien dans la zone
|
||||
if (distance2d(lastPos, position) < 0.2)
|
||||
{ //si elle est bloquée par obstacle
|
||||
{ //si elle est bloquée par obstacle
|
||||
turn(rand()*360-180);
|
||||
motor(1,1);
|
||||
wait(1);
|
||||
|
@ -89,13 +89,13 @@ extern void object::Attack( )
|
|||
r = rand();
|
||||
if (r > 0.7)
|
||||
{ //dans un cas sur dix
|
||||
motor (1, 0.8);// tourne à droite
|
||||
motor (1, 0.8);// tourne à droite
|
||||
wait(rand()*3);// pendant un moment
|
||||
motor (1, 1); // puis tout droit
|
||||
}
|
||||
if (r < 0.3)
|
||||
{ //dans un cas sur dix
|
||||
motor (0.8, 1);// tourne à gauche
|
||||
motor (0.8, 1);// tourne à gauche
|
||||
wait(rand()*3);// pendant un moment
|
||||
motor (1, 1); // puis tout droit
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ extern void object::Attack( )
|
|||
}
|
||||
}
|
||||
else
|
||||
{ // si cible à proximité
|
||||
{ // si cible à proximité
|
||||
turn(direction(target.position));
|
||||
fire(target.position); // et tire deux fois
|
||||
motor(1,1); // avance
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
extern void object::Attack( )
|
||||
{
|
||||
int list[], i; // liste des objets cherchés
|
||||
int list[], i; // liste des objets cherchés
|
||||
object target; // info sur la cible
|
||||
point center; // coordonnées du centre de la zone
|
||||
point lastPos; // dernière position (pr test si bloquée)
|
||||
point center; // coordonnées du centre de la zone
|
||||
point lastPos; // dernière position (pr test si bloquée)
|
||||
float distCent; // rayon de la zone
|
||||
float r; // valeur aléatoire
|
||||
float stdHight; // Altitude du point de départ
|
||||
float tolHight; // tolérance acceptée par rapport à stdHight
|
||||
float r; // valeur aléatoire
|
||||
float stdHight; // Altitude du point de départ
|
||||
float tolHight; // tolérance acceptée par rapport à stdHight
|
||||
|
||||
errmode(0); // ne stoppe pas si erreur
|
||||
while ( ismovie() != 0 ) wait(1);
|
||||
|
@ -36,28 +36,28 @@ extern void object::Attack( )
|
|||
list[i++] = Subber;
|
||||
// list[i++] = Me;
|
||||
|
||||
center.x = cmdline(0); // prend les coordonnée
|
||||
center.x = cmdline(0); // prend les coordonnée
|
||||
center.y = cmdline(1); // du centre de la zone
|
||||
center.z = 0; // à patrouiller
|
||||
center.z = 0; // à patrouiller
|
||||
distCent = cmdline(2); // rayon de la zone
|
||||
stdHight = topo(position);//L'altitude dont il ne faut pas s'écarter
|
||||
stdHight = topo(position);//L'altitude dont il ne faut pas s'écarter
|
||||
tolHight = 9;
|
||||
|
||||
lastPos = position; // initialise
|
||||
motor(1,1); // en avant toute
|
||||
while ( true ) // répère à l'infini
|
||||
while ( true ) // répère à l'infini
|
||||
{
|
||||
target = radar(WingedShooter);
|
||||
if (target.position.y < 20
|
||||
or abs(topo(position)-stdHight) > tolHight)//pas de cible à proximité
|
||||
{ // ou s'écarte trop de l'altitude de départ
|
||||
or abs(topo(position)-stdHight) > tolHight)//pas de cible à proximité
|
||||
{ // ou s'écarte trop de l'altitude de départ
|
||||
if (distance2d(position, center) > distCent or
|
||||
abs(topo(position)-stdHight) > tolHight)
|
||||
{ // si la fourmi est en dehors de la zone
|
||||
motor(0, 0); //s'arrête
|
||||
wait(0.5); //marque un arrêt
|
||||
motor(0, 0); //s'arrête
|
||||
wait(0.5); //marque un arrêt
|
||||
motor (-0.5, -0.5);//recule lentement
|
||||
wait (1.5); //attend qu'ait reculé
|
||||
wait (1.5); //attend qu'ait reculé
|
||||
turn(direction(center));
|
||||
motor (1, 1); //puis en avant toute
|
||||
do
|
||||
|
@ -65,7 +65,7 @@ extern void object::Attack( )
|
|||
lastPos = position;
|
||||
wait(1); //tant que pas dans la zone
|
||||
if (distance2d(lastPos, position) < 0.2)
|
||||
{ //si elle est bloquée par obstacle
|
||||
{ //si elle est bloquée par obstacle
|
||||
turn(rand()*360-180);
|
||||
motor(1,1);
|
||||
wait(1);
|
||||
|
@ -78,7 +78,7 @@ extern void object::Attack( )
|
|||
else
|
||||
{ //si elle est bien dans la zone
|
||||
if (distance2d(lastPos, position) < 0.2)
|
||||
{ //si elle est bloquée par obstacle
|
||||
{ //si elle est bloquée par obstacle
|
||||
turn(rand()*360-180);
|
||||
motor(1,1);
|
||||
wait(1);
|
||||
|
@ -86,13 +86,13 @@ extern void object::Attack( )
|
|||
r = rand();
|
||||
if (r > 0.6)
|
||||
{ //dans un cas sur dix
|
||||
motor (1, 0.5);// tourne à droite
|
||||
motor (1, 0.5);// tourne à droite
|
||||
wait(rand()*3);// pendant un moment
|
||||
motor (1, 1); // puis tout droit
|
||||
}
|
||||
if (r < 0.4)
|
||||
{ //dans un cas sur dix
|
||||
motor (0.5, 1);// tourne à gauche
|
||||
motor (0.5, 1);// tourne à gauche
|
||||
wait(rand()*3);// pendant un moment
|
||||
motor (1, 1); // puis tout droit
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ extern void object::Attack( )
|
|||
}
|
||||
}
|
||||
else
|
||||
{ // si cible à proximité
|
||||
{ // si cible à proximité
|
||||
turn(direction(target.position));
|
||||
fire(target.position); // tourne vers la cible
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
extern void object::Attack( )
|
||||
{
|
||||
int list[], i; // liste des objets cherchés
|
||||
int list[], i; // liste des objets cherchés
|
||||
object target; // info sur la cible
|
||||
point center; // coordonnées du centre de la zone
|
||||
point lastPos; // dernière position (pr test si bloquée)
|
||||
point center; // coordonnées du centre de la zone
|
||||
point lastPos; // dernière position (pr test si bloquée)
|
||||
float distCent; // rayon de la zone
|
||||
float r; // valeur aléatoire
|
||||
float stdHight; // Altitude du point de départ
|
||||
float tolHight; // tolérance acceptée par rapport à stdHight
|
||||
float r; // valeur aléatoire
|
||||
float stdHight; // Altitude du point de départ
|
||||
float tolHight; // tolérance acceptée par rapport à stdHight
|
||||
|
||||
errmode(0); // ne stoppe pas si erreur
|
||||
while ( ismovie() != 0 ) wait(1);
|
||||
|
@ -36,28 +36,28 @@ extern void object::Attack( )
|
|||
list[i++] = Subber;
|
||||
list[i++] = Me;
|
||||
|
||||
center.x = cmdline(0); // prend les coordonnée
|
||||
center.x = cmdline(0); // prend les coordonnée
|
||||
center.y = cmdline(1); // du centre de la zone
|
||||
center.z = 0; // à patrouiller
|
||||
center.z = 0; // à patrouiller
|
||||
distCent = cmdline(2); // rayon de la zone
|
||||
stdHight = topo(position);//L'altitude dont il ne faut pas s'écarter
|
||||
stdHight = topo(position);//L'altitude dont il ne faut pas s'écarter
|
||||
tolHight = 1;
|
||||
|
||||
lastPos = position; // initialise
|
||||
motor(1,1); // en avant toute
|
||||
while ( true ) // répère à l'infini
|
||||
while ( true ) // répère à l'infini
|
||||
{
|
||||
target = radar(list, 0, 360, 0, 40);
|
||||
if (target == null
|
||||
or abs(topo(position)-stdHight) > tolHight)//pas de cible à proximité
|
||||
{ // ou s'écarte trop de l'altitude de départ
|
||||
or abs(topo(position)-stdHight) > tolHight)//pas de cible à proximité
|
||||
{ // ou s'écarte trop de l'altitude de départ
|
||||
if (distance2d(position, center) > distCent or
|
||||
abs(topo(position)-stdHight) > tolHight)
|
||||
{ // si la fourmi est en dehors de la zone
|
||||
motor(0, 0); //s'arrête
|
||||
wait(0.5); //marque un arrêt
|
||||
motor(0, 0); //s'arrête
|
||||
wait(0.5); //marque un arrêt
|
||||
motor (-0.5, -0.5);//recule lentement
|
||||
wait (1.5); //attend qu'ait reculé
|
||||
wait (1.5); //attend qu'ait reculé
|
||||
turn(direction(center));
|
||||
motor (1, 1); //puis en avant toute
|
||||
do
|
||||
|
@ -65,7 +65,7 @@ extern void object::Attack( )
|
|||
lastPos = position;
|
||||
wait(1); //tant que pas dans la zone
|
||||
if (distance2d(lastPos, position) < 0.2)
|
||||
{ //si elle est bloquée par obstacle
|
||||
{ //si elle est bloquée par obstacle
|
||||
turn(rand()*360-180);
|
||||
motor(1,1);
|
||||
wait(1);
|
||||
|
@ -78,7 +78,7 @@ extern void object::Attack( )
|
|||
else
|
||||
{ //si elle est bien dans la zone
|
||||
if (distance2d(lastPos, position) < 0.2)
|
||||
{ //si elle est bloquée par obstacle
|
||||
{ //si elle est bloquée par obstacle
|
||||
turn(rand()*360-180);
|
||||
motor(1,1);
|
||||
wait(1);
|
||||
|
@ -86,13 +86,13 @@ extern void object::Attack( )
|
|||
r = rand();
|
||||
if (r > 0.6)
|
||||
{ //dans un cas sur dix
|
||||
motor (1, 0.5);// tourne à droite
|
||||
motor (1, 0.5);// tourne à droite
|
||||
wait(rand()*3);// pendant un moment
|
||||
motor (1, 1); // puis tout droit
|
||||
}
|
||||
if (r < 0.4)
|
||||
{ //dans un cas sur dix
|
||||
motor (0.5, 1);// tourne à gauche
|
||||
motor (0.5, 1);// tourne à gauche
|
||||
wait(rand()*3);// pendant un moment
|
||||
motor (1, 1); // puis tout droit
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ extern void object::Attack( )
|
|||
}
|
||||
}
|
||||
else
|
||||
{ // si cible à proximité
|
||||
{ // si cible à proximité
|
||||
turn(direction(target.position));
|
||||
fire(target.position); // tourne vers la cible
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
extern void object::Attack( )
|
||||
{
|
||||
int list[], i; // liste des objets cherchés
|
||||
int list[], i; // liste des objets cherchés
|
||||
object target; // info sur la cible
|
||||
point center; // coordonnées du centre de la zone
|
||||
point lastPos; // dernière position (pr test si bloquée)
|
||||
point center; // coordonnées du centre de la zone
|
||||
point lastPos; // dernière position (pr test si bloquée)
|
||||
float distCent; // rayon de la zone
|
||||
float r; // valeur aléatoire
|
||||
float stdHight; // Altitude du point de départ
|
||||
float tolHight; // tolérance acceptée par rapport à stdHight
|
||||
float r; // valeur aléatoire
|
||||
float stdHight; // Altitude du point de départ
|
||||
float tolHight; // tolérance acceptée par rapport à stdHight
|
||||
|
||||
errmode(0); // ne stoppe pas si erreur
|
||||
while ( ismovie() != 0 ) wait(1);
|
||||
|
@ -36,29 +36,29 @@ extern void object::Attack( )
|
|||
list[i++] = Subber;
|
||||
list[i++] = Me;
|
||||
|
||||
center.x = cmdline(0); // prend les coordonnée
|
||||
center.x = cmdline(0); // prend les coordonnée
|
||||
center.y = cmdline(1); // du centre de la zone
|
||||
center.z = 0; // à patrouiller
|
||||
center.z = 0; // à patrouiller
|
||||
distCent = cmdline(2); // rayon de la zone
|
||||
stdHight = topo(position);//L'altitude dont il ne faut pas s'écarter
|
||||
tolHight = cmdline(3); // tolérance admise
|
||||
stdHight = topo(position);//L'altitude dont il ne faut pas s'écarter
|
||||
tolHight = cmdline(3); // tolérance admise
|
||||
|
||||
lastPos = position; // initialise
|
||||
motor(1,1); // en avant toute
|
||||
while ( true ) // répère à l'infini
|
||||
while ( true ) // répère à l'infini
|
||||
{
|
||||
target = radar(list, 0, 360, 0, 40);
|
||||
if (target == null
|
||||
or topo(position)-stdHight > tolHight
|
||||
or stdHight-topo(position) > tolHight)//pas de cible à proximité
|
||||
{ // ou s'écarte trop de l'altitude de départ
|
||||
or stdHight-topo(position) > tolHight)//pas de cible à proximité
|
||||
{ // ou s'écarte trop de l'altitude de départ
|
||||
if (distance2d(position, center) > distCent
|
||||
or abs(topo(position)-stdHight) > tolHight)
|
||||
{ // si la fourmi est en dehors de la zone
|
||||
motor(0, 0); //s'arrête
|
||||
wait(0.5); //marque un arrêt
|
||||
motor(0, 0); //s'arrête
|
||||
wait(0.5); //marque un arrêt
|
||||
motor (-0.5, -0.5);//recule lentement
|
||||
wait (1.5); //attend qu'ait reculé
|
||||
wait (1.5); //attend qu'ait reculé
|
||||
turn(direction(center));
|
||||
motor (1, 1); //puis en avant toute
|
||||
do
|
||||
|
@ -66,7 +66,7 @@ extern void object::Attack( )
|
|||
lastPos = position;
|
||||
wait(1); //tant que pas dans la zone
|
||||
if (distance2d(lastPos, position) < 0.2)
|
||||
{ //si elle est bloquée par obstacle
|
||||
{ //si elle est bloquée par obstacle
|
||||
turn(rand()*360-180);
|
||||
motor(1,1);
|
||||
wait(1);
|
||||
|
@ -79,7 +79,7 @@ extern void object::Attack( )
|
|||
else
|
||||
{ //si elle est bien dans la zone
|
||||
if (distance2d(lastPos, position) < 0.2)
|
||||
{ //si elle est bloquée par obstacle
|
||||
{ //si elle est bloquée par obstacle
|
||||
turn(rand()*360-180);
|
||||
motor(1,1);
|
||||
wait(1);
|
||||
|
@ -87,13 +87,13 @@ extern void object::Attack( )
|
|||
r = rand();
|
||||
if (r > 0.6)
|
||||
{ //dans un cas sur dix
|
||||
motor (1, 0.7);// tourne à droite
|
||||
motor (1, 0.7);// tourne à droite
|
||||
wait(rand()*3);// pendant un moment
|
||||
motor (1, 1); // puis tout droit
|
||||
}
|
||||
if (r < 0.4)
|
||||
{ //dans un cas sur dix
|
||||
motor (0.7, 1);// tourne à gauche
|
||||
motor (0.7, 1);// tourne à gauche
|
||||
wait(rand()*3);// pendant un moment
|
||||
motor (1, 1); // puis tout droit
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ extern void object::Attack( )
|
|||
}
|
||||
}
|
||||
else
|
||||
{ // si cible à proximité
|
||||
{ // si cible à proximité
|
||||
turn(direction(target.position));
|
||||
fire(target.position); // tourne vers la cible
|
||||
motor(1,1); // avance
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
extern void object::Attack( )
|
||||
{
|
||||
int list[], i; // liste des objets cherchés
|
||||
int list[], i; // liste des objets cherchés
|
||||
object target; // info sur la cible
|
||||
point center; // coordonnées du centre de la zone
|
||||
point lastPos; // dernière position (pr test si bloquée)
|
||||
point center; // coordonnées du centre de la zone
|
||||
point lastPos; // dernière position (pr test si bloquée)
|
||||
float distCent; // rayon de la zone
|
||||
float r; // valeur aléatoire
|
||||
float r; // valeur aléatoire
|
||||
float distTar; // distance de la cible
|
||||
float dirTar; // direction de la cible
|
||||
float mp; // puissance moteur
|
||||
|
@ -39,36 +39,36 @@ extern void object::Attack( )
|
|||
list[i++] = Subber;
|
||||
list[i++] = Me;
|
||||
|
||||
center.x = cmdline(0); // prend les coordonnée
|
||||
center.x = cmdline(0); // prend les coordonnée
|
||||
center.y = cmdline(1); // du centre de la zone
|
||||
center.z = 0; // à patrouiller
|
||||
center.z = 0; // à patrouiller
|
||||
distCent = cmdline(2); // rayon de la zone
|
||||
|
||||
lastPos = position; // initialise
|
||||
motor(1,1); // en avant toute
|
||||
while (radar(list, 0, 360, 0, 40) == null) // répète jusqu'à contact
|
||||
while (radar(list, 0, 360, 0, 40) == null) // répète jusqu'à contact
|
||||
{
|
||||
target = radar(list, 0, 360, 0, 40);
|
||||
if (target == null or topo(position)<0)// pas de cible à proximité
|
||||
if (target == null or topo(position)<0)// pas de cible à proximité
|
||||
{ // ou pieds dans l'eau
|
||||
if (distance2d(position, center) > distCent or topo(position)<0)
|
||||
{ // si la fourmi est en dehors de la zone
|
||||
motor(0, 0); //s'arrête
|
||||
wait(0.5); //marque un arrêt
|
||||
motor(0, 0); //s'arrête
|
||||
wait(0.5); //marque un arrêt
|
||||
motor (-0.5, -0.5);//recule lentement
|
||||
wait (1.5); //attend qu'ait reculé
|
||||
wait (1.5); //attend qu'ait reculé
|
||||
if (direction(center)>0) motor (0,1); else motor (1,0);
|
||||
do wait(0.2); //tourne vers le centre
|
||||
while (direction(center) > 20
|
||||
or direction(center) < -20);
|
||||
//tant que pas orienté vers le centre
|
||||
//tant que pas orienté vers le centre
|
||||
motor (1, 1); //puis en avant toute
|
||||
do
|
||||
{
|
||||
lastPos = position;
|
||||
wait(0.5); //tant que pas dans la zone
|
||||
if (distance2d(lastPos, position) < 0.2)
|
||||
{ //si elle est bloquée par obstacle
|
||||
{ //si elle est bloquée par obstacle
|
||||
turn(rand()*360-180);
|
||||
motor(1,1);
|
||||
wait(1);
|
||||
|
@ -80,7 +80,7 @@ extern void object::Attack( )
|
|||
else
|
||||
{ //si elle est bien dans la zone
|
||||
if (distance2d(lastPos, position) < 0.2)
|
||||
{ //si elle est bloquée par obstacle
|
||||
{ //si elle est bloquée par obstacle
|
||||
turn(rand()*360-180);
|
||||
motor(1,1);
|
||||
wait(1);
|
||||
|
@ -88,13 +88,13 @@ extern void object::Attack( )
|
|||
r = rand();
|
||||
if (r > 0.9)
|
||||
{ //dans un cas sur dix
|
||||
motor (1, 0.5);// tourne à droite
|
||||
motor (1, 0.5);// tourne à droite
|
||||
wait(rand()*3);// pendant un moment
|
||||
motor (1, 1); // puis tout droit
|
||||
}
|
||||
if (r < 0.1)
|
||||
{ //dans un cas sur dix
|
||||
motor (0.5, 1);// tourne à gauche
|
||||
motor (0.5, 1);// tourne à gauche
|
||||
wait(rand()*3);// pendant un moment
|
||||
motor (1, 1); // puis tout droit
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ extern void object::Attack( )
|
|||
}
|
||||
}
|
||||
else
|
||||
{ // si cible à proximité
|
||||
{ // si cible à proximité
|
||||
turn(direction(target.position));
|
||||
fire(target.position); // tourne vers la cible
|
||||
fire(target.position); // et tire deux fois
|
||||
|
@ -115,7 +115,7 @@ extern void object::Attack( )
|
|||
//a eu un contact avec l'astronaute
|
||||
lastPos = position; // initialise
|
||||
ifmove = true;
|
||||
while ( true ) // répète à l'infini
|
||||
while ( true ) // répète à l'infini
|
||||
{
|
||||
target = radar(list);
|
||||
dirTar = direction(target.position);
|
||||
|
@ -147,7 +147,7 @@ extern void object::Attack( )
|
|||
{
|
||||
ifmove = true;
|
||||
if (distance(lastPos, position) < 0.2)
|
||||
{ //si elle est bloquée par obstacle
|
||||
{ //si elle est bloquée par obstacle
|
||||
lastPos = position;
|
||||
turn(rand()*360-180);
|
||||
motor(1,1);
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
extern void object::Attack( )
|
||||
{
|
||||
int list[], i; // liste des objets cherchés
|
||||
int list[], i; // liste des objets cherchés
|
||||
object target; // info sur la cible
|
||||
point center; // coordonnées du centre de la zone
|
||||
point lastPos; // dernière position (pr test si bloquée)
|
||||
point center; // coordonnées du centre de la zone
|
||||
point lastPos; // dernière position (pr test si bloquée)
|
||||
float distCent; // rayon de la zone
|
||||
float r; // valeur aléatoire
|
||||
float r; // valeur aléatoire
|
||||
|
||||
errmode(0); // ne stoppe pas si erreur
|
||||
while ( ismovie() != 0 ) wait(1);
|
||||
|
@ -34,24 +34,24 @@ extern void object::Attack( )
|
|||
list[i++] = Subber;
|
||||
list[i++] = Me;
|
||||
|
||||
center.x = cmdline(0); // prend les coordonnée
|
||||
center.x = cmdline(0); // prend les coordonnée
|
||||
center.y = cmdline(1); // du centre de la zone
|
||||
center.z = 0; // à patrouiller
|
||||
center.z = 0; // à patrouiller
|
||||
distCent = cmdline(2); // rayon de la zone
|
||||
|
||||
lastPos = position; // initialise
|
||||
motor(1,1); // en avant toute
|
||||
while ( true ) // répère à l'infini
|
||||
while ( true ) // répère à l'infini
|
||||
{
|
||||
target = radar(list, 0, 360, 0, 40);
|
||||
if (target == null or topo(position)<0)// pas de cible à proximité
|
||||
if (target == null or topo(position)<0)// pas de cible à proximité
|
||||
{ // ou pieds dans l'eau
|
||||
if (distance2d(position, center) > distCent or topo(position)<0)
|
||||
{ // si la fourmi est en dehors de la zone
|
||||
motor(0, 0); //s'arrête
|
||||
wait(0.5); //marque un arrêt
|
||||
motor(0, 0); //s'arrête
|
||||
wait(0.5); //marque un arrêt
|
||||
motor (-0.5, -0.5);//recule lentement
|
||||
wait (1.5); //attend qu'ait reculé
|
||||
wait (1.5); //attend qu'ait reculé
|
||||
turn(direction(center));
|
||||
motor (1, 1); //puis en avant toute
|
||||
do
|
||||
|
@ -59,7 +59,7 @@ extern void object::Attack( )
|
|||
lastPos = position;
|
||||
wait(1); //tant que pas dans la zone
|
||||
if (distance2d(lastPos, position) < 0.2)
|
||||
{ //si elle est bloquée par obstacle
|
||||
{ //si elle est bloquée par obstacle
|
||||
turn(rand()*360-180);
|
||||
motor(1,1);
|
||||
wait(1);
|
||||
|
@ -71,7 +71,7 @@ extern void object::Attack( )
|
|||
else
|
||||
{ //si elle est bien dans la zone
|
||||
if (distance2d(lastPos, position) < 0.2)
|
||||
{ //si elle est bloquée par obstacle
|
||||
{ //si elle est bloquée par obstacle
|
||||
turn(rand()*360-180);
|
||||
motor(1,1);
|
||||
wait(1);
|
||||
|
@ -79,13 +79,13 @@ extern void object::Attack( )
|
|||
r = rand();
|
||||
if (r > 0.6)
|
||||
{ //dans un cas sur dix
|
||||
motor (1, 0.5);// tourne à droite
|
||||
motor (1, 0.5);// tourne à droite
|
||||
wait(rand()*3);// pendant un moment
|
||||
motor (1, 1); // puis tout droit
|
||||
}
|
||||
if (r < 0.4)
|
||||
{ //dans un cas sur dix
|
||||
motor (0.5, 1);// tourne à gauche
|
||||
motor (0.5, 1);// tourne à gauche
|
||||
wait(rand()*3);// pendant un moment
|
||||
motor (1, 1); // puis tout droit
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ extern void object::Attack( )
|
|||
}
|
||||
}
|
||||
else
|
||||
{ // si cible à proximité
|
||||
{ // si cible à proximité
|
||||
turn(direction(target.position));
|
||||
fire(target.position); // tourne vers la cible
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
extern void object::Attack( )
|
||||
{
|
||||
int list[], i; // liste des objets cherchés
|
||||
int list[], i; // liste des objets cherchés
|
||||
object target; // info sur la cible
|
||||
point center; // coordonnées du centre de la zone
|
||||
point lastPos; // dernière position (pr test si bloquée)
|
||||
point center; // coordonnées du centre de la zone
|
||||
point lastPos; // dernière position (pr test si bloquée)
|
||||
float distCent; // rayon de la zone
|
||||
float r; // valeur aléatoire
|
||||
float r; // valeur aléatoire
|
||||
|
||||
errmode(0); // ne stoppe pas si erreur
|
||||
while ( ismovie() != 0 ) wait(1);
|
||||
|
@ -34,24 +34,24 @@ extern void object::Attack( )
|
|||
list[i++] = Subber;
|
||||
list[i++] = Me;
|
||||
|
||||
center.x = cmdline(0); // prend les coordonnée
|
||||
center.x = cmdline(0); // prend les coordonnée
|
||||
center.y = cmdline(1); // du centre de la zone
|
||||
center.z = 0; // à patrouiller
|
||||
center.z = 0; // à patrouiller
|
||||
distCent = cmdline(2); // rayon de la zone
|
||||
|
||||
lastPos = position; // initialise
|
||||
motor(1,1); // en avant toute
|
||||
while ( true ) // répète à l'infini
|
||||
while ( true ) // répète à l'infini
|
||||
{
|
||||
target = radar(list, 0, 360, 0, 40);
|
||||
if (target == null or topo(position)<0)// pas de cible à proximité
|
||||
if (target == null or topo(position)<0)// pas de cible à proximité
|
||||
{ // ou pieds dans l'eau
|
||||
if (distance2d(position, center) > distCent or topo(position)<0)
|
||||
{ // si la fourmi est en dehors de la zone
|
||||
motor(0, 0); //s'arrête
|
||||
wait(0.5); //marque un arrêt
|
||||
motor(0, 0); //s'arrête
|
||||
wait(0.5); //marque un arrêt
|
||||
motor (-0.5, -0.5);//recule lentement
|
||||
wait (1.5); //attend qu'ait reculé
|
||||
wait (1.5); //attend qu'ait reculé
|
||||
turn(direction(center));
|
||||
motor (1, 1); //puis en avant toute
|
||||
do
|
||||
|
@ -59,7 +59,7 @@ extern void object::Attack( )
|
|||
lastPos = position;
|
||||
wait(0.5); //tant que pas dans la zone
|
||||
if (distance2d(lastPos, position) < 0.2)
|
||||
{ //si elle est bloquée par obstacle
|
||||
{ //si elle est bloquée par obstacle
|
||||
turn(rand()*360-180);
|
||||
motor(1,1);
|
||||
wait(1);
|
||||
|
@ -71,7 +71,7 @@ extern void object::Attack( )
|
|||
else
|
||||
{ //si elle est bien dans la zone
|
||||
if (distance2d(lastPos, position) < 0.2)
|
||||
{ //si elle est bloquée par obstacle
|
||||
{ //si elle est bloquée par obstacle
|
||||
turn(rand()*360-180);
|
||||
motor(1,1);
|
||||
wait(1);
|
||||
|
@ -79,13 +79,13 @@ extern void object::Attack( )
|
|||
r = rand();
|
||||
if (r > 0.6)
|
||||
{ //dans un cas sur dix
|
||||
motor (1, 0.7);// tourne à droite
|
||||
motor (1, 0.7);// tourne à droite
|
||||
wait(rand()*3);// pendant un moment
|
||||
motor (1, 1); // puis tout droit
|
||||
}
|
||||
if (r < 0.4)
|
||||
{ //dans un cas sur dix
|
||||
motor (0.7, 1);// tourne à gauche
|
||||
motor (0.7, 1);// tourne à gauche
|
||||
wait(rand()*3);// pendant un moment
|
||||
motor (1, 1); // puis tout droit
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ extern void object::Attack( )
|
|||
}
|
||||
}
|
||||
else
|
||||
{ // si cible à proximité
|
||||
{ // si cible à proximité
|
||||
turn(direction(target.position));
|
||||
fire(target.position); // et tire deux fois
|
||||
motor(1,1); // avance
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
extern void object::Attack( )
|
||||
{
|
||||
int list[], i; // liste des objets cherchés
|
||||
int list[], i; // liste des objets cherchés
|
||||
object target; // info sur la cible
|
||||
point center; // coordonnées du centre de la zone
|
||||
point lastPos; // dernière position (pr test si bloquée)
|
||||
point center; // coordonnées du centre de la zone
|
||||
point lastPos; // dernière position (pr test si bloquée)
|
||||
float distCent; // rayon de la zone
|
||||
float r; // valeur aléatoire
|
||||
float r; // valeur aléatoire
|
||||
float mp; // vitesse maxi
|
||||
float minAlt; // altitude minimale (danger lave!)
|
||||
|
||||
|
@ -36,26 +36,26 @@ extern void object::Attack( )
|
|||
list[i++] = Subber;
|
||||
list[i++] = Me;
|
||||
|
||||
center.x = cmdline(0); // prend les coordonnée
|
||||
center.x = cmdline(0); // prend les coordonnée
|
||||
center.y = cmdline(1); // du centre de la zone
|
||||
center.z = 0; // à patrouiller
|
||||
center.z = 0; // à patrouiller
|
||||
distCent = cmdline(2); // rayon de la zone
|
||||
mp = 0.4;
|
||||
minAlt = cmdline(3);
|
||||
|
||||
lastPos = position; // initialise
|
||||
motor(mp, mp); // en avant toute
|
||||
while ( true ) // répère à l'infini
|
||||
while ( true ) // répère à l'infini
|
||||
{
|
||||
target = radar(list, 0, 360, 0, 40);
|
||||
if (target == null or topo(position)<minAlt)// pas de cible à proximité
|
||||
if (target == null or topo(position)<minAlt)// pas de cible à proximité
|
||||
{ // ou pieds dans l'eau
|
||||
if (distance2d(position, center) > distCent or topo(position)<minAlt)
|
||||
{ // si la fourmi est en dehors de la zone
|
||||
motor(0, 0); //s'arrête
|
||||
wait(0.5); //marque un arrêt
|
||||
motor(0, 0); //s'arrête
|
||||
wait(0.5); //marque un arrêt
|
||||
motor (-0.4, -0.4);//recule lentement
|
||||
wait (1.5); //attend qu'ait reculé
|
||||
wait (1.5); //attend qu'ait reculé
|
||||
turn(direction(center));
|
||||
motor (mp, mp); //puis en avant toute
|
||||
do
|
||||
|
@ -63,7 +63,7 @@ extern void object::Attack( )
|
|||
lastPos = position;
|
||||
wait(0.5); //tant que pas dans la zone
|
||||
if (distance2d(lastPos, position) < 0.1)
|
||||
{ //si elle est bloquée par obstacle
|
||||
{ //si elle est bloquée par obstacle
|
||||
turn(rand()*360-180);
|
||||
motor(mp, mp);
|
||||
wait(0.5);
|
||||
|
@ -75,7 +75,7 @@ extern void object::Attack( )
|
|||
else
|
||||
{ //si elle est bien dans la zone
|
||||
if (distance2d(lastPos, position) < 0.1)
|
||||
{ //si elle est bloquée par obstacle
|
||||
{ //si elle est bloquée par obstacle
|
||||
turn(rand()*360-180);
|
||||
motor(mp, mp);
|
||||
wait(0.5);
|
||||
|
@ -83,13 +83,13 @@ extern void object::Attack( )
|
|||
r = rand();
|
||||
if (r > 0.6)
|
||||
{ //dans un cas sur dix
|
||||
motor (mp, mp*0.5);// tourne à droite
|
||||
motor (mp, mp*0.5);// tourne à droite
|
||||
wait(rand()*2);// pendant un moment
|
||||
motor (mp, mp); // puis tout droit
|
||||
}
|
||||
if (r < 0.4)
|
||||
{ //dans un cas sur dix
|
||||
motor (mp*0.5, mp);// tourne à gauche
|
||||
motor (mp*0.5, mp);// tourne à gauche
|
||||
wait(rand()*2);// pendant un moment
|
||||
motor (mp, mp); // puis tout droit
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ extern void object::Attack( )
|
|||
}
|
||||
}
|
||||
else
|
||||
{ // si cible à proximité
|
||||
{ // si cible à proximité
|
||||
turn(direction(target.position));
|
||||
fire(target.position); // tourne vers la cible
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
extern void object::Attack( )
|
||||
{
|
||||
int list[], i; // liste des objets cherchés
|
||||
int list[], i; // liste des objets cherchés
|
||||
object target; // info sur la cible
|
||||
|
||||
errmode(0); // ne stoppe pas si erreur
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
extern void object::Attack( )
|
||||
{
|
||||
int list[], i; // liste des objets cherchés
|
||||
int list[], i; // liste des objets cherchés
|
||||
object target; // info sur la cible
|
||||
|
||||
errmode(0); // ne stoppe pas si erreur
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
extern void object::Attack( )
|
||||
{
|
||||
int list[], i; // liste des objets cherchés
|
||||
int list[], i; // liste des objets cherchés
|
||||
object target; // info sur la cible
|
||||
object queen; // info sur la reine
|
||||
point center; // coordonnées du centre de la zone
|
||||
point center; // coordonnées du centre de la zone
|
||||
float distCent; // rayon de la zone
|
||||
float r; // valeur aléatoire
|
||||
int ifTarget; // si on a trouvé une cible et quel genre
|
||||
float r; // valeur aléatoire
|
||||
int ifTarget; // si on a trouvé une cible et quel genre
|
||||
|
||||
errmode(0); // ne stoppe pas si erreur
|
||||
while ( ismovie() != 0 ) wait(1);
|
||||
|
@ -35,14 +35,14 @@ extern void object::Attack( )
|
|||
list[i++] = Subber;
|
||||
list[i++] = Me;
|
||||
|
||||
center.x = -65; // prend les coordonnée
|
||||
center.x = -65; // prend les coordonnée
|
||||
center.y = 255; // du centre de la zone
|
||||
center.z = 0; // à patrouiller
|
||||
center.z = 0; // à patrouiller
|
||||
distCent = 140; // rayon de la zone
|
||||
|
||||
motor(1,1); // en avant toute
|
||||
ifTarget = 0; // pas de cible précise
|
||||
while ( true ) // répète à l'infini
|
||||
ifTarget = 0; // pas de cible précise
|
||||
while ( true ) // répète à l'infini
|
||||
{
|
||||
queen = radar(AlienQueen);
|
||||
if (rand() < 0.2 and queen != null) ifTarget = 2;//on retourne vers la reine
|
||||
|
@ -95,10 +95,10 @@ void object::Random(point center, float distCent)
|
|||
|
||||
void object::HorsZone(point center, float distCent)
|
||||
{ // si la fourmi est en dehors de la zone
|
||||
motor(0, 0); //s'arrête
|
||||
wait(0.5); //marque un arrêt
|
||||
motor(0, 0); //s'arrête
|
||||
wait(0.5); //marque un arrêt
|
||||
motor (-0.5, -0.5);//recule lentement
|
||||
wait (1.5); //attend qu'ait reculé
|
||||
wait (1.5); //attend qu'ait reculé
|
||||
turn(direction(center));
|
||||
motor (1, 1); //puis en avant toute
|
||||
do
|
||||
|
@ -113,13 +113,13 @@ void object::DansZone()
|
|||
float r = rand();
|
||||
if (r > 0.6)
|
||||
{ //dans un cas sur dix
|
||||
motor (1, 0.7); // tourne à droite
|
||||
motor (1, 0.7); // tourne à droite
|
||||
wait(rand()*3); // pendant un moment
|
||||
motor (1, 1); // puis tout droit
|
||||
}
|
||||
if (r < 0.4)
|
||||
{ //dans un cas sur dix
|
||||
motor (0.7, 1); // tourne à gauche
|
||||
motor (0.7, 1); // tourne à gauche
|
||||
wait(rand()*3); // pendant un moment
|
||||
motor (1, 1); // puis tout droit
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ void object::DansZone()
|
|||
}
|
||||
|
||||
void object::shoot(point tarPos)
|
||||
{ // si cible à proximité
|
||||
{ // si cible à proximité
|
||||
turn(direction(tarPos));
|
||||
fire(tarPos); // tourne vers la cible
|
||||
fire(tarPos); // et tire deux fois
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
extern void object::Attack( )
|
||||
{
|
||||
int list[], i; // liste des objets cherchés
|
||||
int list[], i; // liste des objets cherchés
|
||||
object target; // info sur la cible
|
||||
point center; // coordonnées du centre de la zone
|
||||
point center; // coordonnées du centre de la zone
|
||||
float distCent; // rayon de la zone
|
||||
float r; // valeur aléatoire
|
||||
int ifTarget; // si on a trouvé une cible et quel genre
|
||||
float r; // valeur aléatoire
|
||||
int ifTarget; // si on a trouvé une cible et quel genre
|
||||
|
||||
errmode(0); // ne stoppe pas si erreur
|
||||
while ( ismovie() != 0 ) wait(1);
|
||||
|
@ -34,14 +34,14 @@ extern void object::Attack( )
|
|||
list[i++] = Subber;
|
||||
list[i++] = Me;
|
||||
|
||||
center.x = -65; // prend les coordonnée
|
||||
center.x = -65; // prend les coordonnée
|
||||
center.y = 255; // du centre de la zone
|
||||
center.z = 0; // à patrouiller
|
||||
center.z = 0; // à patrouiller
|
||||
distCent = 140; // rayon de la zone
|
||||
|
||||
motor(1,1); // en avant toute
|
||||
ifTarget = 0; // pas de cible précise
|
||||
while ( true ) // répète à l'infini
|
||||
ifTarget = 0; // pas de cible précise
|
||||
while ( true ) // répète à l'infini
|
||||
{
|
||||
target = radar(list);
|
||||
if(target.position.y > 65)
|
||||
|
@ -90,10 +90,10 @@ void object::Random(point center, float distCent)
|
|||
|
||||
void object::HorsZone(point center, float distCent)
|
||||
{ // si la fourmi est en dehors de la zone
|
||||
motor(0, 0); //s'arrête
|
||||
wait(0.5); //marque un arrêt
|
||||
motor(0, 0); //s'arrête
|
||||
wait(0.5); //marque un arrêt
|
||||
motor (-0.5, -0.5);//recule lentement
|
||||
wait (1.5); //attend qu'ait reculé
|
||||
wait (1.5); //attend qu'ait reculé
|
||||
turn(direction(center));
|
||||
motor (1, 1); //puis en avant toute
|
||||
do
|
||||
|
@ -108,13 +108,13 @@ void object::DansZone()
|
|||
float r = rand();
|
||||
if (r > 0.8)
|
||||
{ //dans un cas sur dix
|
||||
motor (1, 0.8); // tourne à droite
|
||||
motor (1, 0.8); // tourne à droite
|
||||
wait(rand()*2); // pendant un moment
|
||||
motor (1, 1); // puis tout droit
|
||||
}
|
||||
if (r < 0.2)
|
||||
{ //dans un cas sur dix
|
||||
motor (0.8, 1); // tourne à gauche
|
||||
motor (0.8, 1); // tourne à gauche
|
||||
wait(rand()*2); // pendant un moment
|
||||
motor (1, 1); // puis tout droit
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ void object::DansZone()
|
|||
}
|
||||
|
||||
void object::shoot(point tarPos)
|
||||
{ // si cible à proximité
|
||||
{ // si cible à proximité
|
||||
turn(direction(tarPos));
|
||||
fire(tarPos); // tourne vers la cible
|
||||
fire(tarPos); // et tire deux fois
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
extern void object::Attack( )
|
||||
{
|
||||
int list[], i; // liste des objets cherchés
|
||||
int list[], i; // liste des objets cherchés
|
||||
object target; // info sur la cible
|
||||
point center; // coordonnées du centre de la zone
|
||||
point center; // coordonnées du centre de la zone
|
||||
float distCent; // rayon de la zone
|
||||
float r; // valeur aléatoire
|
||||
int ifTarget; // si on a trouvé une cible et quel genre
|
||||
float r; // valeur aléatoire
|
||||
int ifTarget; // si on a trouvé une cible et quel genre
|
||||
|
||||
errmode(0); // ne stoppe pas si erreur
|
||||
while ( ismovie() != 0 ) wait(1);
|
||||
|
@ -34,14 +34,14 @@ extern void object::Attack( )
|
|||
list[i++] = Subber;
|
||||
list[i++] = Me;
|
||||
|
||||
center.x = -65; // prend les coordonnée
|
||||
center.x = -65; // prend les coordonnée
|
||||
center.y = 255; // du centre de la zone
|
||||
center.z = 0; // à patrouiller
|
||||
center.z = 0; // à patrouiller
|
||||
distCent = 140; // rayon de la zone
|
||||
|
||||
motor(1,1); // en avant toute
|
||||
ifTarget = 0; // pas de cible précise
|
||||
while ( true ) // répète à l'infini
|
||||
ifTarget = 0; // pas de cible précise
|
||||
while ( true ) // répète à l'infini
|
||||
{
|
||||
target = radar(list);
|
||||
if(target.position.y > 180)
|
||||
|
@ -90,10 +90,10 @@ void object::Random(point center, float distCent)
|
|||
|
||||
void object::HorsZone(point center, float distCent)
|
||||
{ // si la fourmi est en dehors de la zone
|
||||
motor(0, 0); //s'arrête
|
||||
wait(0.5); //marque un arrêt
|
||||
motor(0, 0); //s'arrête
|
||||
wait(0.5); //marque un arrêt
|
||||
motor (-0.5, -0.5);//recule lentement
|
||||
wait (1.5); //attend qu'ait reculé
|
||||
wait (1.5); //attend qu'ait reculé
|
||||
turn(direction(center));
|
||||
motor (1, 1); //puis en avant toute
|
||||
do
|
||||
|
@ -108,13 +108,13 @@ void object::DansZone()
|
|||
float r = rand();
|
||||
if (r > 0.8)
|
||||
{ //dans un cas sur dix
|
||||
motor (1, 0.8); // tourne à droite
|
||||
motor (1, 0.8); // tourne à droite
|
||||
wait(rand()*2); // pendant un moment
|
||||
motor (1, 1); // puis tout droit
|
||||
}
|
||||
if (r < 0.2)
|
||||
{ //dans un cas sur dix
|
||||
motor (0.8, 1); // tourne à gauche
|
||||
motor (0.8, 1); // tourne à gauche
|
||||
wait(rand()*2); // pendant un moment
|
||||
motor (1, 1); // puis tout droit
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ void object::DansZone()
|
|||
}
|
||||
|
||||
void object::shoot(point tarPos)
|
||||
{ // si cible à proximité
|
||||
{ // si cible à proximité
|
||||
turn(direction(tarPos));
|
||||
fire(tarPos); // tourne vers la cible
|
||||
fire(tarPos); // et tire deux fois
|
||||
|
|
|
@ -18,7 +18,7 @@ extern void object::Convert( )
|
|||
p = radar(TitaniumOre);
|
||||
if ( p == null )
|
||||
{
|
||||
message("Minerai pas trouvé");
|
||||
message("Minerai pas trouvé");
|
||||
return;
|
||||
}
|
||||
goto(p.position);
|
||||
|
@ -27,26 +27,26 @@ extern void object::Convert( )
|
|||
p = radar(Converter);
|
||||
if ( p == null )
|
||||
{
|
||||
message("Convertisseur pas trouvé");
|
||||
message("Convertisseur pas trouvé");
|
||||
return;
|
||||
}
|
||||
goto(p.position);
|
||||
drop(); // dépose minerai
|
||||
drop(); // dépose minerai
|
||||
move(-4);
|
||||
wait(15); // attend conversion
|
||||
move(4);
|
||||
grab(); // prend métal
|
||||
grab(); // prend métal
|
||||
move(-4);
|
||||
}
|
||||
|
||||
p = radar(SpaceShip);
|
||||
if ( p == null )
|
||||
{
|
||||
message("Vaisseau spatial pas trouvé");
|
||||
message("Vaisseau spatial pas trouvé");
|
||||
return;
|
||||
}
|
||||
goto(p.position);
|
||||
drop(); // dépose minerai
|
||||
drop(); // dépose minerai
|
||||
|
||||
if ( energyCell.energyLevel < 0.25 )
|
||||
{
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
extern void object::Attack( )
|
||||
{
|
||||
int list[], i; // liste des objets cherchés
|
||||
int list[], i; // liste des objets cherchés
|
||||
object target; // info sur la cible
|
||||
point center; // coordonnées du centre de la zone
|
||||
point lastPos; // dernière position (pr test si bloquée)
|
||||
point center; // coordonnées du centre de la zone
|
||||
point lastPos; // dernière position (pr test si bloquée)
|
||||
float distCent; // rayon de la zone
|
||||
float r; // valeur aléatoire
|
||||
float r; // valeur aléatoire
|
||||
|
||||
errmode(0); // ne stoppe pas si erreur
|
||||
while ( ismovie() != 0 ) wait(1);
|
||||
|
@ -34,24 +34,24 @@ extern void object::Attack( )
|
|||
list[i++] = Subber;
|
||||
list[i++] = Me;
|
||||
|
||||
center.x = cmdline(0); // prend les coordonnée
|
||||
center.x = cmdline(0); // prend les coordonnée
|
||||
center.y = cmdline(1); // du centre de la zone
|
||||
center.z = 0; // à patrouiller
|
||||
center.z = 0; // à patrouiller
|
||||
distCent = cmdline(2); // rayon de la zone
|
||||
|
||||
lastPos = position; // initialise
|
||||
motor(1,1); // en avant toute
|
||||
while ( true ) // répère à l'infini
|
||||
while ( true ) // répère à l'infini
|
||||
{
|
||||
target = radar(list, 0, 360, 0, 10);
|
||||
if (target == null or topo(position)<0)// pas de cible à proximité
|
||||
if (target == null or topo(position)<0)// pas de cible à proximité
|
||||
{ // ou pieds dans l'eau
|
||||
if (distance2d(position, center) > distCent or topo(position)<0)
|
||||
{ // si la fourmi est en dehors de la zone
|
||||
motor(0, 0); //s'arrête
|
||||
wait(0.5); //marque un arrêt
|
||||
motor(0, 0); //s'arrête
|
||||
wait(0.5); //marque un arrêt
|
||||
motor (-0.5, -0.5);//recule lentement
|
||||
wait (1.5); //attend qu'ait reculé
|
||||
wait (1.5); //attend qu'ait reculé
|
||||
turn(direction(center));
|
||||
motor (1, 1); //puis en avant toute
|
||||
do
|
||||
|
@ -59,7 +59,7 @@ extern void object::Attack( )
|
|||
lastPos = position;
|
||||
wait(1); //tant que pas dans la zone
|
||||
if (distance2d(lastPos, position) < 0.2)
|
||||
{ //si elle est bloquée par obstacle
|
||||
{ //si elle est bloquée par obstacle
|
||||
turn(rand()*360-180);
|
||||
motor(1,1);
|
||||
wait(1);
|
||||
|
@ -71,7 +71,7 @@ extern void object::Attack( )
|
|||
else
|
||||
{ //si elle est bien dans la zone
|
||||
if (distance2d(lastPos, position) < 0.2)
|
||||
{ //si elle est bloquée par obstacle
|
||||
{ //si elle est bloquée par obstacle
|
||||
turn(rand()*360-180);
|
||||
motor(1,1);
|
||||
wait(1);
|
||||
|
@ -79,13 +79,13 @@ extern void object::Attack( )
|
|||
r = rand();
|
||||
if (r > 0.6)
|
||||
{ //dans un cas sur dix
|
||||
motor (1, 0.7);// tourne à droite
|
||||
motor (1, 0.7);// tourne à droite
|
||||
wait(rand()*3);// pendant un moment
|
||||
motor (1, 1); // puis tout droit
|
||||
}
|
||||
if (r < 0.4)
|
||||
{ //dans un cas sur dix
|
||||
motor (0.7, 1);// tourne à gauche
|
||||
motor (0.7, 1);// tourne à gauche
|
||||
wait(rand()*3);// pendant un moment
|
||||
motor (1, 1); // puis tout droit
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ extern void object::Attack( )
|
|||
}
|
||||
}
|
||||
else
|
||||
{ // si cible à proximité
|
||||
{ // si cible à proximité
|
||||
fire();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,11 +36,11 @@ extern void object::Solution( )
|
|||
dir = (dir+bomb)/2;
|
||||
}
|
||||
|
||||
if ( dir < 0 ) // à droite ?
|
||||
if ( dir < 0 ) // à droite ?
|
||||
{
|
||||
motor(1, 1+dir/90);
|
||||
}
|
||||
else // à gauche ?
|
||||
else // à gauche ?
|
||||
{
|
||||
motor(1-dir/90, 1);
|
||||
}
|
||||
|
|
|
@ -29,11 +29,11 @@ extern void object::Solution( )
|
|||
}
|
||||
}
|
||||
|
||||
if ( dir < 0 ) // à droite ?
|
||||
if ( dir < 0 ) // à droite ?
|
||||
{
|
||||
motor(1, 1+dir/90);
|
||||
}
|
||||
else // à gauche ?
|
||||
else // à gauche ?
|
||||
{
|
||||
motor(1-dir/90, 1);
|
||||
}
|
||||
|
|
|
@ -51,14 +51,14 @@ extern void object::Attack( )
|
|||
{
|
||||
if ( load == null ) // ne porte rien ?
|
||||
{
|
||||
p = radar(OrgaMatter); // cherche matière
|
||||
p = radar(OrgaMatter); // cherche matière
|
||||
if ( p == null )
|
||||
{
|
||||
jet(1); // monte
|
||||
dest = position;
|
||||
dest.x += (rand()-0.5)*10;
|
||||
dest.y += (rand()-0.5)*10;
|
||||
goto(dest); // va n'importe où
|
||||
goto(dest); // va n'importe où
|
||||
wait(2);
|
||||
}
|
||||
else
|
||||
|
@ -69,17 +69,17 @@ extern void object::Attack( )
|
|||
if ( dist > 1.25 )
|
||||
{
|
||||
jet(1); // monte
|
||||
goto(p.position); // va sur le matière
|
||||
goto(p.position); // va sur le matière
|
||||
}
|
||||
else
|
||||
{
|
||||
jet(-1); // descend
|
||||
while ( altitude > 0 );
|
||||
grab(); // prend la matière
|
||||
grab(); // prend la matière
|
||||
}
|
||||
}
|
||||
}
|
||||
else // porte matière ?
|
||||
else // porte matière ?
|
||||
{
|
||||
jet(1); // monte
|
||||
p = radar(list, 0, 360, 0, 1000, 1, FilterOnlyLanding);
|
||||
|
@ -88,7 +88,7 @@ extern void object::Attack( )
|
|||
dest = position;
|
||||
dest.x += (rand()-0.5)*10;
|
||||
dest.y += (rand()-0.5)*10;
|
||||
goto(dest); // va n'importe où
|
||||
goto(dest); // va n'importe où
|
||||
wait(2);
|
||||
}
|
||||
else
|
||||
|
@ -102,7 +102,7 @@ extern void object::Attack( )
|
|||
}
|
||||
else
|
||||
{
|
||||
drop(); // lâche la matière
|
||||
drop(); // lâche la matière
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,14 +15,14 @@ extern void object::Attack( )
|
|||
{
|
||||
if ( load == null ) // ne porte rien ?
|
||||
{
|
||||
p = radar(OrgaMatter); // cherche matière
|
||||
p = radar(OrgaMatter); // cherche matière
|
||||
if ( p == null )
|
||||
{
|
||||
jet(1); // monte
|
||||
dest = position;
|
||||
dest.x += (rand()-0.5)*10;
|
||||
dest.y += (rand()-0.5)*10;
|
||||
goto(dest); // va n'importe où
|
||||
goto(dest); // va n'importe où
|
||||
wait(2);
|
||||
}
|
||||
else
|
||||
|
@ -34,17 +34,17 @@ extern void object::Attack( )
|
|||
if ( dist > 1.25 )
|
||||
{
|
||||
jet(1); // monte
|
||||
goto(p.position); // va sur la matière
|
||||
goto(p.position); // va sur la matière
|
||||
}
|
||||
else
|
||||
{
|
||||
jet(-1); // descend
|
||||
while ( altitude > 0 );
|
||||
grab(); // prend la matière
|
||||
grab(); // prend la matière
|
||||
}
|
||||
}
|
||||
}
|
||||
else // porte matière ?
|
||||
else // porte matière ?
|
||||
{
|
||||
jet(1); // monte
|
||||
p = radar(list, 0, 360, 0, 1000, 1, FilterOnlyLanding);
|
||||
|
@ -53,7 +53,7 @@ extern void object::Attack( )
|
|||
dest = center;
|
||||
dest.x += (rand()-0.5)*100;
|
||||
dest.y += (rand()-0.5)*100;
|
||||
goto(dest, 0, 1, 0); // va n'importe où
|
||||
goto(dest, 0, 1, 0); // va n'importe où
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -66,7 +66,7 @@ extern void object::Attack( )
|
|||
}
|
||||
else
|
||||
{
|
||||
drop(); // lâche la matière
|
||||
drop(); // lâche la matière
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,14 +51,14 @@ extern void object::Attack( )
|
|||
{
|
||||
if ( load == null ) // ne porte rien ?
|
||||
{
|
||||
p = radar(OrgaMatter); // cherche matière
|
||||
p = radar(OrgaMatter); // cherche matière
|
||||
if ( p == null )
|
||||
{
|
||||
jet(1); // monte
|
||||
dest = position;
|
||||
dest.x += (rand()-0.5)*10;
|
||||
dest.y += (rand()-0.5)*10;
|
||||
goto(dest); // va n'importe où
|
||||
goto(dest); // va n'importe où
|
||||
wait(2);
|
||||
}
|
||||
else
|
||||
|
@ -69,17 +69,17 @@ extern void object::Attack( )
|
|||
if ( dist > 1.25 )
|
||||
{
|
||||
jet(1); // monte
|
||||
goto(p.position); // va sur la matière
|
||||
goto(p.position); // va sur la matière
|
||||
}
|
||||
else
|
||||
{
|
||||
jet(-1); // descend
|
||||
while ( altitude > 0 );
|
||||
grab(); // prend la matière
|
||||
grab(); // prend la matière
|
||||
}
|
||||
}
|
||||
}
|
||||
else // porte matière ?
|
||||
else // porte matière ?
|
||||
{
|
||||
jet(1); // monte
|
||||
p = radar(list, 0, 360, 0, 1000, 1, FilterOnlyLanding);
|
||||
|
@ -88,7 +88,7 @@ extern void object::Attack( )
|
|||
dest = position;
|
||||
dest.x += (rand()-0.5)*10;
|
||||
dest.y += (rand()-0.5)*10;
|
||||
goto(dest); // va n'importe où
|
||||
goto(dest); // va n'importe où
|
||||
wait(2);
|
||||
}
|
||||
else
|
||||
|
@ -102,7 +102,7 @@ extern void object::Attack( )
|
|||
}
|
||||
else
|
||||
{
|
||||
drop(); // lâche la matière
|
||||
drop(); // lâche la matière
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
extern void object::Guêpes()
|
||||
extern void object::Guêpes()
|
||||
{
|
||||
float p;// puissance max des moteurs
|
||||
float r;// nombre aléatoire
|
||||
float r;// nombre aléatoire
|
||||
point c;// centre de la zone permise
|
||||
|
||||
c.x = 0;
|
||||
|
|
|
@ -21,7 +21,7 @@ extern void object::Attack( )
|
|||
{
|
||||
dist = distance(p.position, position);
|
||||
prox = dist/2; // on se rapproche
|
||||
if ( prox < 2.5 ) prox = 2.5; // pas trop tout de même
|
||||
if ( prox < 2.5 ) prox = 2.5; // pas trop tout de même
|
||||
dest.x = (position.x-p.position.x)*prox/dist + p.position.x;
|
||||
dest.y = (position.y-p.position.y)*prox/dist + p.position.y;
|
||||
dest.z = (position.z-p.position.z)*prox/dist + p.position.z;
|
||||
|
|
|
@ -89,8 +89,8 @@ extern void object::Attack( )
|
|||
}
|
||||
}
|
||||
|
||||
// Cherche une cible sur l'île. Si la cible est plus loin,
|
||||
// elle est ignorée.
|
||||
// Cherche une cible sur l'île. Si la cible est plus loin,
|
||||
// elle est ignorée.
|
||||
|
||||
object object::TargetSearch(int[] list)
|
||||
{
|
||||
|
@ -102,7 +102,7 @@ object object::TargetSearch(int[] list)
|
|||
if ( p == null ) return null;
|
||||
|
||||
center.x = 0;
|
||||
center.y = 100; // sommet de l'île
|
||||
center.y = 100; // sommet de l'île
|
||||
center.z = p.position.z;
|
||||
dist = distance(p.position, center);
|
||||
if ( dist > 80 ) return null; // ignore si trop loin
|
||||
|
|
|
@ -2,6 +2,6 @@ Development team: Beta tester core team:
|
|||
|
||||
- Daniel Roux - Adrien Roux - Michael Jubin
|
||||
- Denis Dumoulin - Didier Raboud - Daniel Sauthier
|
||||
- Otto Kölbl - Nicolas Beuchat - Nicolas Stubi
|
||||
- Michael Walz - Joël Roux - Patrick Thévoz
|
||||
- Otto Kölbl - Nicolas Beuchat - Nicolas Stubi
|
||||
- Michael Walz - Joël Roux - Patrick Thévoz
|
||||
- Didier Gertsch
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
\b;Instruction \c;abstime\n;
|
||||
Syntax<EFBFBD>:
|
||||
Syntax¦:
|
||||
\s;\c;abstime ( );\n;
|
||||
|
||||
Return the time in seconds elapsed since the beginning of the mission.
|
||||
|
|
|
@ -13,7 +13,7 @@ Actually when the CBOT interpreter encounters an array declaration, it just crea
|
|||
As soon as you put values into the array, the elements are created and the reference is initialized:
|
||||
\c;
|
||||
\s;a[2] = 213; // a points to
|
||||
\s; // 3 élements [0], [1] et [2]
|
||||
\s; // 3 élements [0], [1] et [2]
|
||||
\n;
|
||||
After this operation, \c;a\n; contains a reference to the elements of the array. Elements \c;[0]\n; and \c;[1]\n; are created but not initialized because an array cannot contain empty elements. The \c;\l;sizeof\u cbot\sizeof;\n; instruction allows you to obtain the number of elements contained in an array.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
\b;Instruction \c;close\n;
|
||||
Close a file opened previously with \c;\l;open\u cbot\open;\n;. This is a method of the \c;\l;file\u cbot\file;\n; class; therefore you cannot write \c;close()\n; but only \c;handle.close()\n;¦:
|
||||
Close a file opened previously with \c;\l;open\u cbot\open;\n;. This is a method of the \c;\l;file\u cbot\file;\n; class; therefore you cannot write \c;close()\n; but only \c;handle.close()\n;¦:
|
||||
\c;
|
||||
\s; handle.close();
|
||||
\n;
|
||||
|
|
|
@ -3,7 +3,7 @@ The deletefile instruction deletes an existing file in the files/ folder.
|
|||
|
||||
Files can only be deleted in the files/ folder which is located in the folder where Colobot has been installed. You cannot not delete files that are located elsewhere than in the files/ folder.
|
||||
|
||||
Syntax<EFBFBD>:
|
||||
Syntax¦:
|
||||
\s;\c;deletefile ( filename );\n;
|
||||
|
||||
\t;See also
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
\b;Instruction \c;deleteinfo\n;
|
||||
Syntax¦:
|
||||
Syntax¦:
|
||||
\s;\c;deleteinfo ( name, power );\n;
|
||||
|
||||
Delete an existing information in the closest \l;information exchange post\u object\exchange;.
|
||||
|
||||
\t;name: \c;string\n;
|
||||
Name of the information to be deleted. This name is a string: it must be written in quotation marks "¦".
|
||||
Name of the information to be deleted. This name is a string: it must be written in quotation marks "¦".
|
||||
|
||||
\t;power: \c;float\n;
|
||||
Power of the transmitter, which corresponds to the maximal distance between the sender and the exchange post. If the distance is longer, the information won't be deleted. Default value is 10 metres.
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
\b;Instruction \c;eof\n;
|
||||
Test the end of file condition of an open file. This is a method of the \c;\l;file\u cbot\file;\n; class; therefore you cannot write \c;eof()\n; but only \c;handle.eof()\n;¦:
|
||||
Test the end of file condition of an open file. This is a method of the \c;\l;file\u cbot\file;\n; class; therefore you cannot write \c;eof()\n; but only \c;handle.eof()\n;¦:
|
||||
\c;
|
||||
\s; if ( handle.eof() )
|
||||
\n;
|
||||
Example¦:
|
||||
Example¦:
|
||||
\c;
|
||||
\s; while ( not handle.eof() )
|
||||
\s; {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The \c;errmode();\n; instruction allows you to chose if the program should stop when an error occurs in one of the following instructions: \c;\l;goto\u cbot\goto;\n;, \c;\l;move\u cbot\move;\n;, \c;\l;grab\u cbot\grab;\n;, \c;\l;drop\u cbot\drop;\n;, etc.
|
||||
|
||||
\b;For specialists
|
||||
Syntax¦:
|
||||
Syntax¦:
|
||||
\s;\c;errmode ( mode );\n;
|
||||
|
||||
Normally the program is stopped when an error occurs. If you use the instruction \c;errmode(0);\n; at the beginning of the program, the instructions listed above return a value different from zero if the instruction could not be performed.
|
||||
|
@ -12,14 +12,14 @@ Error treatment mode.
|
|||
\c;0\n; -> continues program execution and returns a non zero value
|
||||
\c;1\n; -> stops the program (default behavior)
|
||||
|
||||
Exemple 1¦:
|
||||
Exemple 1¦:
|
||||
\s;\c;errmode(0);
|
||||
\s;while ( goto(pos) != 0 )
|
||||
\s;{
|
||||
\s; wait(2);
|
||||
\s;}
|
||||
\n;
|
||||
Exemple 2¦:
|
||||
Exemple 2¦:
|
||||
\s;\c;errmode(0);
|
||||
\s;int err;
|
||||
\s;err = goto(pos);
|
||||
|
|
|
@ -8,7 +8,7 @@ Use the syntax above for declaring a file handle. You must use () to create an i
|
|||
Files can only be created and opened in the files/ folder which is located in the folder where Colobot has been installed. You cannot not create or open files elsewhere than in the files/ folder.
|
||||
|
||||
\b;For specialists
|
||||
\c;file\n; is actually not a simple type but a class. \c;open\n;, \c;close\n;, \c;writeln\n; etc. are methods of the \c;file\n; class. This is the reason why we always write \c;handle.method()\n;¦:
|
||||
\c;file\n; is actually not a simple type but a class. \c;open\n;, \c;close\n;, \c;writeln\n; etc. are methods of the \c;file\n; class. This is the reason why we always write \c;handle.method()\n;¦:
|
||||
\c;
|
||||
\s; handle.open("test.txt", "w");
|
||||
\s; handle.close();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
\b;Instruction \c;flatground\n;
|
||||
Syntax<EFBFBD>:
|
||||
Syntax¦:
|
||||
\s;\c;flatground ( center, rmax );\n;
|
||||
|
||||
Calculates the maximal radius of a flat zone on which a building ca be built.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
\b;Functions
|
||||
With functions you can divide your program into several parts, each of them will execute a specific task.
|
||||
Let's imagine following program¦:
|
||||
Let's imagine following program¦:
|
||||
\c;
|
||||
\s;extern void object::Remote( )
|
||||
\s;{
|
||||
|
@ -29,7 +29,7 @@ Let's imagine following program
|
|||
\s; SendToPost(4);
|
||||
\s;}
|
||||
\n;
|
||||
A function can have paramteters¦:
|
||||
A function can have paramteters¦:
|
||||
\c;
|
||||
\s;void Example( int a, float x, string s )
|
||||
\n;
|
||||
|
@ -51,7 +51,7 @@ A function can also return a result with the \c;\l;return\u cbot\return;\n; inst
|
|||
\s; message( value ); // will display 4
|
||||
\s;}
|
||||
\n;
|
||||
Some other examples¦:
|
||||
Some other examples¦:
|
||||
\c;
|
||||
\s;float Pi( )
|
||||
\s;{
|
||||
|
@ -61,11 +61,11 @@ Some other examples
|
|||
\s;string Sign( float a )
|
||||
\s;{
|
||||
\s; if ( a > 0 ) return "positive";
|
||||
\s; if ( a < 0 ) return "négative";
|
||||
\s; if ( a < 0 ) return "négative";
|
||||
\s; return "null";
|
||||
\s;}
|
||||
\n;
|
||||
You can declare several functions with the same name but different parameters¦:
|
||||
You can declare several functions with the same name but different parameters¦:
|
||||
\c;
|
||||
\s;float Pythagoras( float a, float b )
|
||||
\s;{
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
\b;Instruction \c;open\n;
|
||||
Open a text file in the files/ folder. This is a method of the \c;\l;file\u cbot\file;\n; class. This is the reason why we always write \c;handle.open()\n;¦:
|
||||
Open a text file in the files/ folder. This is a method of the \c;\l;file\u cbot\file;\n; class. This is the reason why we always write \c;handle.open()\n;¦:
|
||||
\c;
|
||||
\s; handle.open("test.txt", "w");
|
||||
\n;
|
||||
To open a file, proceed as follows¦:
|
||||
To open a file, proceed as follows¦:
|
||||
\c;
|
||||
\s; file handle();
|
||||
\s; handle.open("filename", "w");
|
||||
|
|
|
@ -23,7 +23,7 @@ If you pass a \l;class\u cbot\class; instance as parameter to a function, the fu
|
|||
\s; item.a = 33; // modifie the local instance
|
||||
\s;}
|
||||
\n;
|
||||
Calling the fucntion \c;Test()\n;¦:
|
||||
Calling the fucntion \c;Test()\n;¦:
|
||||
\c;\s;{
|
||||
\s; MyClass toto();
|
||||
\s; Test(toto);
|
||||
|
@ -32,7 +32,7 @@ Calling the fucntion \c;Test()\n;
|
|||
\n;
|
||||
The instance containing the field \c;a = 33\n; is referenced only by the newly created instance \c;item\n; inside the fucntion \c;Test\n;. At the end of \c;Test\n; this newly created instance referenced by \c;item\n; is automatically deleted.
|
||||
|
||||
A function can return an instance¦:
|
||||
A function can return an instance¦:
|
||||
\c;\s;MyClass Test2( )
|
||||
\s;{
|
||||
\s; MyClass item = new MyClass();
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
\c;
|
||||
\s;public class MyClass
|
||||
\s;{
|
||||
\s; int b; // public by défault
|
||||
\s; int b; // public by défault
|
||||
\s; public int a; // als public
|
||||
\s; private point position; // privat
|
||||
\s;}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
\b;Instruction \c;public\n; (for specialists)
|
||||
This instruction has two distinct purposes¦:
|
||||
This instruction has two distinct purposes¦:
|
||||
|
||||
1) Make a function available to other bots.
|
||||
2) Make a class member accessible from outside the class definition.
|
||||
|
@ -7,7 +7,7 @@ This instruction has two distinct purposes
|
|||
\b;Instruction \c;public\n; for functions
|
||||
If you put \c;public\n; before a \l;function\u cbot\function; definition, you can make the function available to programs in other bots in the same mission.
|
||||
|
||||
For example in the first bot we would have¦:
|
||||
For example in the first bot we would have¦:
|
||||
\c;
|
||||
\s;public void object::Segment(float dist, float angle)
|
||||
\s;{
|
||||
|
@ -15,7 +15,7 @@ For example in the first bot we would have
|
|||
\s; turn(angle);
|
||||
\s;}
|
||||
\n;
|
||||
And in another bot we would have¦:
|
||||
And in another bot we would have¦:
|
||||
\c;
|
||||
\s;extern void object::Square( )
|
||||
\s;{
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
\b;Instruction \c;readln\n;
|
||||
Read one line from an open file in the files/ folder. This is a method of the \c;\l;file\u cbot\file;\n; class. This is the reason why we always write \c;handle.readln()\n;¦:
|
||||
Read one line from an open file in the files/ folder. This is a method of the \c;\l;file\u cbot\file;\n; class. This is the reason why we always write \c;handle.readln()\n;¦:
|
||||
\c;
|
||||
\s; s = handle.readln();
|
||||
\n;
|
||||
The file must have been opened for reading (\c;"r"\n;) with the \c;\l;open\u cbot\open;\n; instruction. \c;readln\n; returns the string containing the whole line but without the end of line characters 0x0D (CR) and 0x0A (LF).
|
||||
|
||||
Syntax¦:
|
||||
Syntax¦:
|
||||
\s;\c;string = handle.readln ( );\n;
|
||||
|
||||
Example¦:
|
||||
Example¦:
|
||||
\c;
|
||||
\s; string s;
|
||||
\s; s = handle.readln();
|
||||
|
|
|
@ -5,7 +5,7 @@ Syntax:
|
|||
Retrieves an information from the closest \l;information exchange post\u object\exchange;.
|
||||
|
||||
\t;name: \c;string\n;
|
||||
Name of the information required from the exchange post. This name is a string: it must be written in quotation marks "¦".
|
||||
Name of the information required from the exchange post. This name is a string: it must be written in quotation marks "¦".
|
||||
|
||||
\t;power: \c;float\n;
|
||||
Power of the receiver, which corresponds to maximal distance between the receiver and the exchange post. If the distance is longer, no information is received. Default value is 10 metres.
|
||||
|
|
|
@ -22,7 +22,7 @@ If the \l;function\u cbot\function; has a return type, the \c;return\n; instruct
|
|||
\s;string Sign (float a)
|
||||
\s;{
|
||||
\s; if ( a > 0 ) return "positive";
|
||||
\s; if ( a < 0 ) return "négative";
|
||||
\s; if ( a < 0 ) return "négative";
|
||||
\s; return "null";
|
||||
\s;}
|
||||
\n;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
\b;Instruction \c;send\n;
|
||||
Syntax¦:
|
||||
Syntax¦:
|
||||
\s;\c;send ( name, value, power );\n;
|
||||
|
||||
Sends an information to the closest \l;information exchange post\u object\exchange;.
|
||||
|
||||
\t;name: \c;string\n;
|
||||
Name of the information to be sent to the exchange post. This name is a string: it must be written in quotation marks "¦".
|
||||
Name of the information to be sent to the exchange post. This name is a string: it must be written in quotation marks "¦".
|
||||
If there is any information having this name, a new entry is created, as far as the total number of entries does not exceed 10. If there is already an information having this name, value is simply replaced by the new.
|
||||
|
||||
\t;value: \c;float\n;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
\b;Instruction \c;strfind\n;
|
||||
Find a substring in a string and returns the position of the first substring found or \l;nan\u cbot\nan; if the substring has not been found.
|
||||
|
||||
Syntax¦:
|
||||
Syntax¦:
|
||||
\s;\c;strfind ( string, sub );\n;
|
||||
|
||||
\t;string: \c;\l;string\u cbot\string;\n;
|
||||
|
@ -10,7 +10,7 @@ String we are searching in.
|
|||
\t;sub: \c;\l;string\u cbot\string;\n;
|
||||
Substring we are searching for.
|
||||
|
||||
Examples¦:
|
||||
Examples¦:
|
||||
\s;\c; int pos = strfind("abcdef", "ab"); // pos will be 0
|
||||
\s; int pos = strfind("abcdef", "de"); // pos will be 3
|
||||
\s; int pos = strfind("abcdef", "xy"); // pos will be \l;nan\u cbot\nan;
|
||||
|
|
|
@ -13,13 +13,13 @@ You can append two strings with the \c;+\n; operator :
|
|||
Returns the string:
|
||||
\s;\c; "Good morning, Sir"
|
||||
\n;
|
||||
If you want to put a quotation mark (") or a backslash (\) in a string you must write¦:
|
||||
If you want to put a quotation mark (") or a backslash (\) in a string you must write¦:
|
||||
\s;\c;"This is \"very\" important"
|
||||
\n;which will result in the string \c; This is "very" important.
|
||||
\s;\c;"%user%\\ant.txt"
|
||||
\n;will result in \c;%user%\ant.txt
|
||||
\n;
|
||||
Following instructions can be used with strings¦:
|
||||
Following instructions can be used with strings¦:
|
||||
\c;\l;strlen\u cbot\strlen; \n;Get string length
|
||||
\c;\l;strleft\u cbot\strleft; \n;Extract left part
|
||||
\c;\l;strright\u cbot\strright; \n;Extract right part
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
\b;Instruction \c;strleft\n;
|
||||
Extracts the first (that is, leftmost) characters from a string.
|
||||
|
||||
Syntax¦:
|
||||
Syntax¦:
|
||||
\s;\c;strleft ( string, len );\n;
|
||||
|
||||
\t;len: \c;\l;int\u cbot\int;\n;
|
||||
Number of characters to be extracted.
|
||||
|
||||
Examples¦:
|
||||
Examples¦:
|
||||
\s;\c; string s = strleft("abcdef", 2); // s is "ab"
|
||||
\s; string s = strleft("abc", 10); // s is "abc"
|
||||
\n;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
\b;Instruction \c;strlen\n;
|
||||
Get the length of a string.
|
||||
|
||||
Syntax¦:
|
||||
Syntax¦:
|
||||
\s;\c;strlen ( string );\n;
|
||||
|
||||
Examples¦:
|
||||
Examples¦:
|
||||
\s;\c; int len = strlen("abc"); // len is 3
|
||||
\s; int len = strlen(""); // len is 0
|
||||
\s; if ( strlen(s) == 0 ) // is string empty ?
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
\b;Instruction \c;strlower\n;
|
||||
Convert all characters in a string to lowercase.
|
||||
|
||||
Syntax¦:
|
||||
Syntax¦:
|
||||
\s;\c;strlower ( string );\n;
|
||||
|
||||
Examples¦:
|
||||
Examples¦:
|
||||
\s;\c; string s = strlower("Abc"); // s is "abc"
|
||||
\n;
|
||||
\t;See also
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
\b;Instruction \c;strmid\n;
|
||||
Extracts a substring of a given length starting at a given position from a string.
|
||||
|
||||
Syntax¦:
|
||||
Syntax¦:
|
||||
\s;\c;strmid ( string, pos, len );\n;
|
||||
|
||||
\t;pos: \c;\l;int\u cbot\int;\n;
|
||||
|
@ -10,7 +10,7 @@ The index of the first character that is to be included in the extracted substri
|
|||
\t;len: \c;\l;int\u cbot\int;\n;
|
||||
Number of characters to be extracted.
|
||||
|
||||
Examples¦:
|
||||
Examples¦:
|
||||
\s;\c; string s = strmid("abcdef", 1, 2); // s is "bc"
|
||||
\s; string s = strmid("abcdef", 4, 5); // s is "ef"
|
||||
\s; string s = strmid("abcdef", 9, 2); // s is ""
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
\b;Instruction \c;strright\n;
|
||||
Extracts the last (that is, rightmost) characters from a string.
|
||||
|
||||
Syntax¦:
|
||||
Syntax¦:
|
||||
\s;\c;strright ( string, len );\n;
|
||||
|
||||
\t;len: \c;\l;int\u cbot\int;\n;
|
||||
Number of characters to be extracted.
|
||||
|
||||
Examples¦:
|
||||
Examples¦:
|
||||
\s;\c; string s = strright("abcdef", 2); // s is "ef"
|
||||
\s; string s = strright("abc", 10); // s is "abc"
|
||||
\n;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
\b;Instruction \c;strupper\n;
|
||||
Convert all characters in a string to uppercase.
|
||||
|
||||
Syntax¦:
|
||||
Syntax¦:
|
||||
\s;\c;strupper ( string );\n;
|
||||
|
||||
Examples¦:
|
||||
Examples¦:
|
||||
\s;\c; string s = strupper("Abc"); // s is "ABC"
|
||||
\n;
|
||||
\t;See also
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
\b;Instruction \c;strval\n;
|
||||
Convert a string to a number. Don't confuse the string \c;"45"\n; that contains actually the two characters \c;4\n; and \c;5\n; and the number \c;45\n;.
|
||||
|
||||
Examples¦:
|
||||
Examples¦:
|
||||
\s;\c; string s = "45"+"12"; // s contains "4512"
|
||||
\s; float n = 45 + 12; // n contains 67
|
||||
\n;
|
||||
Syntax¦:
|
||||
Syntax¦:
|
||||
\s;\c;strval ( string );\n;
|
||||
\n;
|
||||
Examples¦:
|
||||
Examples¦:
|
||||
\s;\c; float n = strval("1.23"); // n is 1.23
|
||||
\s; float n = strval("12abc45"); // n is 12
|
||||
\s; float n = strval("abc"); // n is 0
|
||||
|
|
|
@ -15,7 +15,7 @@ The following example illustrates the problem:
|
|||
\s; }
|
||||
\s;}
|
||||
\n;
|
||||
What happens if two bots execute the \c;inc\n; method at the same time¦?
|
||||
What happens if two bots execute the \c;inc\n; method at the same time¦?
|
||||
Both of them will execute \c;val=nb\n; and wait 2 seconds so both of them will have \c;val=33\n;. With \c;synchronized\n; the first bot starts execution with \c;val=33\n; and then waits 2 seconds and returns. Only once the first bot has returned from the \c;inc\n; method, the second bot will be allowed to enter the \c;inc\n; method and therefore the second bot will always have \c;val=34\n;.
|
||||
|
||||
You can have more than one synchronized method in your \l;class\u cbot\class; in order to prevent simultaneous execution across more than one method. In other words: as long as a bot's program is inside a synchronized method, no other bot can enter any synchronized method of the same class.
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
\b;Instruction \c;testinfo\n;
|
||||
Syntax¦:
|
||||
Syntax¦:
|
||||
\s;\c;testinfo ( name, power );\n;
|
||||
|
||||
Tests if an information exists in the closest \l;information exchange post\u object\exchange;.
|
||||
|
||||
\t;name: \c;string\n;
|
||||
Name of the information to be tested in the exchange post. This name is a string: it must be written in quotation marks "¦".
|
||||
Name of the information to be tested in the exchange post. This name is a string: it must be written in quotation marks "¦".
|
||||
|
||||
\t;power: \c;float\n;
|
||||
Power of the transmitter, which corresponds to the maximal distance between the transmitter and the exchange post. If the distance is longer, the function returns \c;false\n;. Default value is 10 metres.
|
||||
|
|
|
@ -51,4 +51,4 @@ However if a field name is hidden by a parameter declaration or a variable decla
|
|||
\n;
|
||||
\t;See also
|
||||
\c;\l;class\u cbot\class;\n;
|
||||
\l;Programming\u cbot;, \l;types\u cbot\type; et \l;catégories\u cbot\category;.
|
||||
\l;Programming\u cbot;, \l;types\u cbot\type; et \l;catégories\u cbot\category;.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
\b;Instruction \c;writeln\n;
|
||||
Write one line of text to an open file in the files/ folder. This is a method of the \c;\l;file\u cbot\file;\n; class. This is the reason why we always write \c;handle.writeln()\n;¦:
|
||||
Write one line of text to an open file in the files/ folder. This is a method of the \c;\l;file\u cbot\file;\n; class. This is the reason why we always write \c;handle.writeln()\n;¦:
|
||||
\c;
|
||||
\s; handle.writeln("abc");
|
||||
\n;
|
||||
The file must have been opened for writing (\c;"w"\n;) with the \c;\l;open\u cbot\open;\n; instruction. The line will automatically be terminated by the end of line characters 0x0D (CR) and 0x0A (LF).
|
||||
|
||||
Syntax¦:
|
||||
Syntax¦:
|
||||
\s;\c;handle.writeln ( string );\n;
|
||||
|
||||
Examples¦:
|
||||
Examples¦:
|
||||
\c;
|
||||
\s; writeln("Line of text");
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
\b;\button 172; Information Exchange Post
|
||||
\image info 8 8;
|
||||
This building stores digital information. A post can contain up to 10 pieces of information, each one referenced by a name.
|
||||
For example, a post can contain 3 informations¦:\c;
|
||||
For example, a post can contain 3 informations¦:\c;
|
||||
\tab;"Position.x" 23.45
|
||||
\tab;"Position.y" -102.70
|
||||
\tab;"Quantity" 3.00
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
\b;Exercise
|
||||
Remote control a robot using an \l;information exchange post\u object\exchange;, so it will transport \l;uranium ore\u object\uranore;.
|
||||
The main actors of this exercise are¦:
|
||||
The main actors of this exercise are¦:
|
||||
|
||||
1) A \l;sniffer\u object\botsr; (can't carry anything).
|
||||
2) An \l;information exchange post\u object\exchange; that receives information from a sender and then transmits it to a receiver.
|
||||
3) A \l;grabber\u object\botgr; which waits for orders from the exchange post. You have no way control this robot directly.
|
||||
|
||||
\image tremot1a 16 8;
|
||||
An information exchange post stores "name/value" couples. To control the "slave" robot we use just one couple¦:
|
||||
An information exchange post stores "name/value" couples. To control the "slave" robot we use just one couple¦:
|
||||
|
||||
name="order", valuer=order number
|
||||
|
||||
The slace robot understands following orders¦:
|
||||
The slace robot understands following orders¦:
|
||||
\c;
|
||||
1 -> grab(); // take an object
|
||||
2 -> drop(); // drop an object
|
||||
3 -> move(10); // move 10 meters forward
|
||||
4 -> move(-10); // move 10 meters backwards
|
||||
\n;
|
||||
To instruct the slave to move forward 10 meters all you have to do is¦:
|
||||
To instruct the slave to move forward 10 meters all you have to do is¦:
|
||||
\c;\s; \l;send\u cbot\send;("order", 3, 100); // order 3 -> "move(10)"
|
||||
\n;
|
||||
After the send instruction we wait for 5 seconds to be sure the move is done.
|
||||
|
@ -26,7 +26,7 @@ After the send instruction we wait for 5 seconds to be sure the move is done.
|
|||
\n;
|
||||
Remark: There is a better way for waiting the order has been executed, but we'll see this later in exercise "Remote Control #2".
|
||||
|
||||
To finish the exercise you must¦:
|
||||
To finish the exercise you must¦:
|
||||
|
||||
1) Take the uranium ore
|
||||
2) Move forward by 10 meters
|
||||
|
|
|
@ -1,32 +1,32 @@
|
|||
\b;Exercise
|
||||
Remote control a robot using an \l;information exchange post\u object\exchange;, so it will pass over the 6 blue waypoints.
|
||||
The main actors of this exercise are¦:
|
||||
The main actors of this exercise are¦:
|
||||
|
||||
1) A \l;wheeled grabber\u object\botgr; robot without an energy cell. This is the master you have to program.
|
||||
2) An \l;information exchange post\u object\exchange; that receives information from the master and then transmits it to the slave.
|
||||
3) A \l;practice bot\u object\bottr; which waits for orders from the exchange post. This robot has already been programmed.
|
||||
|
||||
\image tremot2a 16 8;
|
||||
An information exchange post stores "name/value" couples. To control the "slave" robot we use two couples¦:
|
||||
An information exchange post stores "name/value" couples. To control the "slave" robot we use two couples¦:
|
||||
|
||||
1) name="order", value=order number
|
||||
2) nom="param", valuer=parameter for the operation
|
||||
|
||||
Order #1 means "move" and order #2 means "turn". The parameter is the distance to move or the turning angle. For example to make the slave move 20 meters write¦:
|
||||
Order #1 means "move" and order #2 means "turn". The parameter is the distance to move or the turning angle. For example to make the slave move 20 meters write¦:
|
||||
\c;\s; \l;send\u cbot\send;("order", 1, 100); // order "move"
|
||||
\s; \l;send\u cbot\send;("param", 20, 100); // distance 20 meters
|
||||
\n;
|
||||
These two instruction send following 2 pieces of information to the exchange post¦:
|
||||
These two instruction send following 2 pieces of information to the exchange post¦:
|
||||
\c; order=1
|
||||
param=20
|
||||
\n;
|
||||
The slave robot waits for an order and executes it. Once the order has been executed by the slave, it removes the order from the exchange post. Once an order has been sent, the master must wait for the slave finishing the order before sending the next order. This is done by testing if the order is still inside the exchange post. Just write¦:
|
||||
The slave robot waits for an order and executes it. Once the order has been executed by the slave, it removes the order from the exchange post. Once an order has been sent, the master must wait for the slave finishing the order before sending the next order. This is done by testing if the order is still inside the exchange post. Just write¦:
|
||||
\c;\s; while ( \l;testinfo\u cbot\testinfo;("order", 100) ) // wait for end of work
|
||||
\s; {
|
||||
\s; wait(1);
|
||||
\s; }
|
||||
\n;
|
||||
As we must give more than one order its most convenient to write a \l;function\u cbot\function; \c;SendToPost\n;, that sends the order and wait for its completion¦:
|
||||
As we must give more than one order its most convenient to write a \l;function\u cbot\function; \c;SendToPost\n;, that sends the order and wait for its completion¦:
|
||||
\c;\s;void object::SendToPost(float order, float param)
|
||||
\s;{
|
||||
\s; send("param", param, 100); // send the parameter
|
||||
|
@ -38,10 +38,10 @@ As we must give more than one order its most convenient to write a \l;function\u
|
|||
\s; }
|
||||
\s;}
|
||||
\n;
|
||||
To move forward by 20 meters, you must write in the main program¦:
|
||||
To move forward by 20 meters, you must write in the main program¦:
|
||||
\c;\s; SendToPost(1, 20); // move(20);
|
||||
\n;
|
||||
This is the route the robot must travel through¦:
|
||||
This is the route the robot must travel through¦:
|
||||
|
||||
\image tremot2b 8 8;
|
||||
It's up to you to finish the programming.
|
||||
|
|
|
@ -6,7 +6,7 @@ The two main actors of this exercise are:
|
|||
2) The slave \l;practice bot\u object\bottr; which is already programmed and just waits for orders from the master.
|
||||
|
||||
\b;The slave
|
||||
First of all we must understand how the program of the slave works. The \l;class\u cbot\class; \c;order\n; contains two members: \c;m_type\n; is the order to execute (move or turn) and \c;m_param\n; is the distance to move or the rotation angle¦:
|
||||
First of all we must understand how the program of the slave works. The \l;class\u cbot\class; \c;order\n; contains two members: \c;m_type\n; is the order to execute (move or turn) and \c;m_param\n; is the distance to move or the rotation angle¦:
|
||||
|
||||
\c;\s;\l;public\u cbot\public; \l;class\u cbot\class; order
|
||||
\s;{
|
||||
|
@ -20,7 +20,7 @@ A second \l;class\u cbot\class; \c;exchange\n; contains the mechanism for exchan
|
|||
\s;{
|
||||
\s; \l;static\u cbot\static; \l;private\u cbot\private; order m_order = new order;
|
||||
\n;
|
||||
\n;The \c;put\n; method will be used by the master robot for transmitting an order. As long as \c;m_order\n; is different from \c;\l;nan\u cbot\nan;\n;, the slave has not finished the order and the \c;put\n; method will return \c;false\n; and will do nothing¦:
|
||||
\n;The \c;put\n; method will be used by the master robot for transmitting an order. As long as \c;m_order\n; is different from \c;\l;nan\u cbot\nan;\n;, the slave has not finished the order and the \c;put\n; method will return \c;false\n; and will do nothing¦:
|
||||
|
||||
\c;\s; \l;synchronized\u cbot\synchro; \l;bool\u cbot\bool; put(order a)
|
||||
\s; {
|
||||
|
@ -83,7 +83,7 @@ Now we have received the order in the \c;todo\n; variable. All we have to do is
|
|||
\s; message("Unknown order");
|
||||
\s; }
|
||||
\n;
|
||||
As soon as the execution of the order is finished, we must call the \c;delete\n; method so the master knows that another order can be sent¦:
|
||||
As soon as the execution of the order is finished, we must call the \c;delete\n; method so the master knows that another order can be sent¦:
|
||||
|
||||
\c;\s; list.delete();
|
||||
\s; }
|
||||
|
|
|
@ -8,7 +8,7 @@ The two main actors of this exercise are:
|
|||
The orders shall be stored, so the master will be able to transmit several orders without waiting for each order being processed. We use an \l;array\u cbot\array; for this purpose.
|
||||
|
||||
\b;The slave
|
||||
First of all we must understand how the program of the slave works. The \l;class\u cbot\class; \c;order\n; contains two members: \c;m_type\n; is the order to execute (move or turn) and \c;m_param\n; is the distance to move or the rotation angle¦:
|
||||
First of all we must understand how the program of the slave works. The \l;class\u cbot\class; \c;order\n; contains two members: \c;m_type\n; is the order to execute (move or turn) and \c;m_param\n; is the distance to move or the rotation angle¦:
|
||||
|
||||
\c;\s;\l;public\u cbot\public; \l;class\u cbot\class; order
|
||||
\s;{
|
||||
|
@ -28,7 +28,7 @@ The \c;put\n; method will be used by the master robot for transmitting an order.
|
|||
\s; m_fifo[sizeof(m_fifo)] = a;
|
||||
\s; }
|
||||
\n;
|
||||
Another method \c;get\n; will be used by the slave to retrieve the orders. This method returns the order to be executed. If the list is empty, \c;null\n; will be returned and the robot must wait for more orders. Otherwise the first order in the list must be returned and the remaining orders must be "scrolled up". As an array can not be "shortened" we use a temporary array \c;copy\n;¦:
|
||||
Another method \c;get\n; will be used by the slave to retrieve the orders. This method returns the order to be executed. If the list is empty, \c;null\n; will be returned and the robot must wait for more orders. Otherwise the first order in the list must be returned and the remaining orders must be "scrolled up". As an array can not be "shortened" we use a temporary array \c;copy\n;¦:
|
||||
|
||||
\c;\s; \l;synchronized\u cbot\synchro; order get()
|
||||
\s; {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
Title.F text="Suivre un chemin"
|
||||
Resume.F text="Déplacer un robot le long d'une trajectoire donnée."
|
||||
Resume.F text="Déplacer un robot le long d'une trajectoire donnée."
|
||||
Title.E text="Follow a path"
|
||||
Resume.E text="Move the bot along a given path."
|
||||
ScriptName.F text="Déplace"
|
||||
ScriptName.F text="Déplace"
|
||||
ScriptName.E text="Move"
|
||||
Instructions name="dmove1.txt" immediat=1
|
||||
HelpFile name="cbot.txt"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Title.F text="Massacre"
|
||||
Resume.F text="Détruire quatre cibles à l'aide d'une boucle."
|
||||
Resume.F text="Détruire quatre cibles à l'aide d'une boucle."
|
||||
Title.E text="Massacre"
|
||||
Resume.E text="Use a loop in order to destroy four targets."
|
||||
ScriptName.F text="Go"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Title.F text="Bornes"
|
||||
Resume.F text="Récolter des informations de direction et de distance."
|
||||
Resume.F text="Récolter des informations de direction et de distance."
|
||||
Title.E text="Exchange posts 3"
|
||||
Resume.E text="Collect lots of valuable information from information exchange posts."
|
||||
ScriptName.F text="Suivre"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Title.F text="Le petit poucet"
|
||||
Resume.F text="Utilisez le radar pour trouver toutes les marques déposées par le petit poucet."
|
||||
Resume.F text="Utilisez le radar pour trouver toutes les marques déposées par le petit poucet."
|
||||
Title.E text="Crazy bot 2"
|
||||
Resume.E text="Use the radar to put some order into a big mess left behind by a crazy bot."
|
||||
ScriptName.F text="Ramasse"
|
||||
|
@ -70,7 +70,7 @@ CreateObject pos=36.25;-67.50 dir=1.0 type=Me option=2
|
|||
CreateObject pos=32.50;-65.00 dir=1.0 type=PracticeBot reset=1 trainer=1 soluce="tradar1.txt" select=1
|
||||
CreateObject pos=20.00;-77.50 dir=1.0 type=WheeledSniffer reset=1 script1="tradar2.txt" run=1
|
||||
|
||||
// Ligne supérieure.
|
||||
// Ligne supérieure.
|
||||
CreateObject pos= 7.50;-62.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=12.50;-62.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=17.50;-62.50 dir=0.0 type=Barrier1
|
||||
|
@ -78,7 +78,7 @@ CreateObject pos=22.50;-62.50 dir=0.0 type=Barrier1
|
|||
CreateObject pos=27.50;-62.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=32.50;-62.50 dir=0.0 type=Barrier1
|
||||
|
||||
// Ligne inférieure.
|
||||
// Ligne inférieure.
|
||||
CreateObject pos= 7.50;-92.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=12.50;-92.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=17.50;-92.50 dir=0.0 type=Barrier1
|
||||
|
|
|
@ -71,7 +71,7 @@ CreateObject pos=36.25;-67.50 dir=1.0 type=Me option=2
|
|||
CreateObject pos=32.50;-65.00 dir=1.0 type=PracticeBot reset=1 trainer=1 soluce="tfollow1.txt" select=1
|
||||
CreateObject pos=20.00;-77.50 dir=1.0 type=TargetBot reset=1 script1="tfollow2.txt" run=1
|
||||
|
||||
// Ligne supérieure.
|
||||
// Ligne supérieure.
|
||||
CreateObject pos= 7.50;-62.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=12.50;-62.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=17.50;-62.50 dir=0.0 type=Barrier1
|
||||
|
@ -79,7 +79,7 @@ CreateObject pos=22.50;-62.50 dir=0.0 type=Barrier1
|
|||
CreateObject pos=27.50;-62.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=32.50;-62.50 dir=0.0 type=Barrier1
|
||||
|
||||
// Ligne inférieure.
|
||||
// Ligne inférieure.
|
||||
CreateObject pos= 7.50;-92.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=12.50;-92.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=17.50;-92.50 dir=0.0 type=Barrier1
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Title.F text="Au secours"
|
||||
Resume.F text="Défendez-vous de toutes les attaques ennemies."
|
||||
Resume.F text="Défendez-vous de toutes les attaques ennemies."
|
||||
Title.E text="Help"
|
||||
Resume.E text="Defend yourself agains all alien attacks."
|
||||
ScriptName.F text="Protect"
|
||||
|
@ -80,13 +80,13 @@ CreateObject pos= 36.00;-150.00 dir=1.0 type=AlienAnt reset=1 script1="tprot1a.
|
|||
CreateObject pos= 89.00; -29.00 dir=1.0 type=AlienAnt reset=1 script1="tprot1a.txt" run=1
|
||||
CreateObject pos= -30.00;-100.00 dir=1.0 type=AlienAnt reset=1 script1="tprot1a.txt" run=1
|
||||
|
||||
// Ligne supérieure.
|
||||
// Ligne supérieure.
|
||||
CreateObject pos=12.50;-67.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=17.50;-67.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=22.50;-67.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=27.50;-67.50 dir=0.0 type=Barrier1
|
||||
|
||||
// Ligne inférieure.
|
||||
// Ligne inférieure.
|
||||
CreateObject pos=12.50;-87.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=17.50;-87.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=22.50;-87.50 dir=0.0 type=Barrier1
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Title.F text="Radar et pièges 1"
|
||||
Resume.F text="Utilisez le radar pour trouver des objets répartis aléatoirement, en évitant les bombes."
|
||||
Title.F text="Radar et pièges 1"
|
||||
Resume.F text="Utilisez le radar pour trouver des objets répartis aléatoirement, en évitant les bombes."
|
||||
Title.E text="Radar and traps 1"
|
||||
Resume.E text="Use your radar to look for various items, but watch out for the mines."
|
||||
ScriptName.F text="Cherche"
|
||||
|
@ -69,7 +69,7 @@ BeginObject
|
|||
CreateObject pos=36.25;-67.50 dir=1.0 type=Me option=2
|
||||
CreateObject pos=32.50;-65.00 dir=1.0 type=PracticeBot reset=1 trainer=1 soluce="ttrap1.txt" select=1
|
||||
|
||||
// Ligne supérieure.
|
||||
// Ligne supérieure.
|
||||
CreateObject pos= 7.50;-62.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=12.50;-62.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=17.50;-62.50 dir=0.0 type=Barrier1
|
||||
|
@ -77,7 +77,7 @@ CreateObject pos=22.50;-62.50 dir=0.0 type=Barrier1
|
|||
CreateObject pos=27.50;-62.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=32.50;-62.50 dir=0.0 type=Barrier1
|
||||
|
||||
// Ligne inférieure.
|
||||
// Ligne inférieure.
|
||||
CreateObject pos= 7.50;-92.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=12.50;-92.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=17.50;-92.50 dir=0.0 type=Barrier1
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Title.F text="Radar et pièges 2"
|
||||
Title.F text="Radar et pièges 2"
|
||||
Resume.F text="A vous d'imaginer comment survivre dans un milieu hostile."
|
||||
Title.E text="Radar and traps 2"
|
||||
Resume.E text="Try to figure out how to survive in a hostile environment."
|
||||
|
@ -69,7 +69,7 @@ BeginObject
|
|||
CreateObject pos=37.50;-65.00 dir=1.0 type=Me option=2
|
||||
CreateObject pos=32.50;-65.00 dir=1.0 type=PracticeBot reset=1 trainer=1 soluce="ttrap2.txt" power=1 select=1
|
||||
|
||||
// Ligne supérieure.
|
||||
// Ligne supérieure.
|
||||
CreateObject pos= 7.50;-62.50 dir=0.0 type=Mine
|
||||
CreateObject pos=10.00;-62.50 dir=0.0 type=Mine
|
||||
CreateObject pos=12.50;-62.50 dir=0.0 type=Mine
|
||||
|
@ -82,7 +82,7 @@ CreateObject pos=27.50;-62.50 dir=0.0 type=Mine
|
|||
CreateObject pos=30.00;-62.50 dir=0.0 type=Mine
|
||||
CreateObject pos=32.50;-62.50 dir=0.0 type=Mine
|
||||
|
||||
// Ligne inférieure.
|
||||
// Ligne inférieure.
|
||||
CreateObject pos= 7.50;-92.50 dir=0.0 type=Mine
|
||||
CreateObject pos=10.00;-92.50 dir=0.0 type=Mine
|
||||
CreateObject pos=12.50;-92.50 dir=0.0 type=Mine
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Title.F text="Déplacements" resume="Déplace"
|
||||
Title.F text="Déplacements" resume="Déplace"
|
||||
Title.E text="Mover" resume="Move"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
Title.F text="Le déménageur 1"
|
||||
Resume.F text="Déplacer du minerai pour le convertir en métal."
|
||||
Title.F text="Le déménageur 1"
|
||||
Resume.F text="Déplacer du minerai pour le convertir en métal."
|
||||
Title.E text="Mover 1"
|
||||
Resume.E text="Retrieve some titanium ore in order to convert it to titanium cubes."
|
||||
ScriptName.F text="Déplace"
|
||||
ScriptName.F text="Déplace"
|
||||
ScriptName.E text="Mover"
|
||||
Instructions name="dremova1.txt" immediat=1
|
||||
HelpFile name="cbot.txt"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
Title.F text="Le déménageur 2"
|
||||
Resume.F text="Déplacer un cube de métal par dessus des obstacles."
|
||||
Title.F text="Le déménageur 2"
|
||||
Resume.F text="Déplacer un cube de métal par dessus des obstacles."
|
||||
Title.E text="Mover 2"
|
||||
Resume.E text="Try to figure out how to move the titanium cube across obstacles."
|
||||
ScriptName.F text="Déplace"
|
||||
ScriptName.F text="Déplace"
|
||||
ScriptName.E text="Mover"
|
||||
Instructions name="dremova2.txt" immediat=1
|
||||
HelpFile name="cbot.txt"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
Title.F text="Une fonction"
|
||||
Resume.F text="Créer une fonction pour déplacer un robot."
|
||||
Resume.F text="Créer une fonction pour déplacer un robot."
|
||||
Title.E text="Function"
|
||||
Resume.E text="Create a function to move a bot."
|
||||
ScriptName.F text="Déplace"
|
||||
ScriptName.F text="Déplace"
|
||||
ScriptName.E text="Move"
|
||||
Instructions name="dproc1.txt" immediat=1
|
||||
HelpFile name="cbot.txt"
|
||||
|
@ -69,7 +69,7 @@ BeginObject
|
|||
CreateObject pos=36.25;-67.50 dir=1.0 type=Me option=2
|
||||
CreateObject pos=32.50;-65.00 dir=1.0 type=PracticeBot reset=1 trainer=1 soluce="tproc1.txt" select=1
|
||||
|
||||
// Ligne supérieure.
|
||||
// Ligne supérieure.
|
||||
CreateObject pos= 7.50;-62.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=12.50;-62.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=17.50;-62.50 dir=0.0 type=Barrier1
|
||||
|
@ -77,7 +77,7 @@ CreateObject pos=22.50;-62.50 dir=0.0 type=Barrier1
|
|||
CreateObject pos=27.50;-62.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=32.50;-62.50 dir=0.0 type=Barrier1
|
||||
|
||||
// Ligne inférieure.
|
||||
// Ligne inférieure.
|
||||
CreateObject pos= 7.50;-92.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=12.50;-92.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=17.50;-92.50 dir=0.0 type=Barrier1
|
||||
|
@ -101,7 +101,7 @@ CreateObject pos=35.00;-80.00 dir=0.5 type=Barrier1
|
|||
CreateObject pos=35.00;-85.00 dir=0.5 type=Barrier1
|
||||
CreateObject pos=35.00;-90.00 dir=0.5 type=Barrier1
|
||||
|
||||
// L intérieur
|
||||
// L intérieur
|
||||
CreateObject pos=12.50;-67.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=10.00;-70.00 dir=0.5 type=Barrier1
|
||||
CreateObject pos=15.00;-70.00 dir=0.5 type=Barrier1
|
||||
|
@ -126,7 +126,7 @@ CreateObject pos=17.50;-85.00 dir=0.0 type=Greenery4
|
|||
CreateObject pos=22.50;-85.00 dir=0.0 type=Greenery2
|
||||
CreateObject pos=27.50;-85.00 dir=0.0 type=Greenery3
|
||||
|
||||
// Petit carré intérieur
|
||||
// Petit carré intérieur
|
||||
CreateObject pos=22.50;-67.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=27.50;-67.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=22.50;-77.50 dir=0.0 type=Barrier1
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
Title.F text="La spirale"
|
||||
Resume.F text="Créer une fonction pour déplacer un robot dans une spirale."
|
||||
Resume.F text="Créer une fonction pour déplacer un robot dans une spirale."
|
||||
Title.E text="Spiral 2"
|
||||
Resume.E text="Create a procedure in order to teach your bot to perform a spiral."
|
||||
ScriptName.F text="Déplace"
|
||||
ScriptName.F text="Déplace"
|
||||
ScriptName.E text="Move"
|
||||
Instructions name="dproc2.txt" immediat=1
|
||||
HelpFile name="cbot.txt"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Title.F text="Jeu libre"
|
||||
Resume.F text="Construisez quelques bâtiments et robots, juste pour vous amuser, sans but précis."
|
||||
Resume.F text="Construisez quelques bâtiments et robots, juste pour vous amuser, sans but précis."
|
||||
Title.E text="Free game"
|
||||
Resume.E text="Do whatever you want, build a base camp and some bots, without any precise objective."
|
||||
Instructions name="fglobal.txt"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Title.F text="Jeu libre"
|
||||
Resume.F text="Construisez quelques bâtiments et robots, juste pour vous amuser, sans but précis."
|
||||
Resume.F text="Construisez quelques bâtiments et robots, juste pour vous amuser, sans but précis."
|
||||
Title.E text="Free game"
|
||||
Resume.E text="Do whatever you want, build a base camp and some bots, without any precise objective."
|
||||
Instructions name="fglobal.txt"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Title.F text="Jeu libre"
|
||||
Resume.F text="Construisez quelques bâtiments et robots, juste pour vous amuser, sans but précis."
|
||||
Resume.F text="Construisez quelques bâtiments et robots, juste pour vous amuser, sans but précis."
|
||||
Title.E text="Free game"
|
||||
Resume.E text="Do whatever you want, build a base camp and some bots, without any precise objective."
|
||||
Instructions name="fglobal.txt"
|
||||
|
@ -222,7 +222,7 @@ CreateObject pos= 210; 141 dir=1.1 type=Greenery19
|
|||
CreateObject pos= 211; 138 dir=0.3 type=Greenery17
|
||||
CreateObject pos= 188; 143 dir=0.7 type=Greenery16
|
||||
|
||||
// Vallée nord
|
||||
// Vallée nord
|
||||
CreateObject pos= -63; 245 dir=0.2 type=MegaStalk5
|
||||
CreateObject pos= -73; 255 dir=1.0 type=MegaStalk3
|
||||
CreateObject pos= -68; 231 dir=0.6 type=MegaStalk1
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Title.F text="Jeu libre"
|
||||
Resume.F text="Construisez quelques bâtiments et robots, juste pour vous amuser, sans but précis."
|
||||
Resume.F text="Construisez quelques bâtiments et robots, juste pour vous amuser, sans but précis."
|
||||
Title.E text="Free game"
|
||||
Resume.E text="Do whatever you want, build a base camp and some bots, without any precise objective."
|
||||
Instructions name="fglobal.txt"
|
||||
|
@ -105,7 +105,7 @@ CreateObject pos=80.00;90.00 dir=0.9 type=Quartz1
|
|||
CreateObject pos=82.50;96.25 dir=0.1 type=Quartz2
|
||||
CreateObject pos=85.00;100.00 dir=0.0 type=Quartz0
|
||||
|
||||
// cratère
|
||||
// cratère
|
||||
CreateObject pos=-9.25; 97.50 dir=0.1 type=Quartz0 h=-0.5
|
||||
CreateObject pos=-8.00; 97.50 dir=0.2 type=Quartz1 h=1.5
|
||||
CreateObject pos=-5.00; 91.75 dir=0.0 type=Quartz2
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Title.F text="Jeu libre"
|
||||
Resume.F text="Construisez quelques bâtiments et robots, juste pour vous amuser, sans but précis."
|
||||
Resume.F text="Construisez quelques bâtiments et robots, juste pour vous amuser, sans but précis."
|
||||
Title.E text="Free game"
|
||||
Resume.E text="Do whatever you want, build a base camp and some bots, without any precise objective."
|
||||
Instructions name="fglobal.txt"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Title.F text="Jeu libre"
|
||||
Resume.F text="Construisez quelques bâtiments et robots, juste pour vous amuser, sans but précis."
|
||||
Resume.F text="Construisez quelques bâtiments et robots, juste pour vous amuser, sans but précis."
|
||||
Title.E text="Free game"
|
||||
Resume.E text="Do whatever you want, build a base camp and some bots, without any precise objective."
|
||||
Instructions name="fglobal.txt"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Title.F text="Jeu libre"
|
||||
Resume.F text="Construisez quelques bâtiments et robots, juste pour vous amuser, sans but précis."
|
||||
Resume.F text="Construisez quelques bâtiments et robots, juste pour vous amuser, sans but précis."
|
||||
Title.E text="Free game"
|
||||
Resume.E text="Do whatever you want, build a base camp and some bots, without any precise objective."
|
||||
Instructions name="fglobal.txt"
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Title.F text="Sur Orphéon" resume="Orphéon"
|
||||
Title.F text="Sur Orphéon" resume="Orphéon"
|
||||
Title.E text="On Orpheon" resume="Orpheon"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Title.F text="Jeu libre"
|
||||
Resume.F text="Construisez quelques bâtiments et robots, juste pour vous amuser, sans but précis."
|
||||
Resume.F text="Construisez quelques bâtiments et robots, juste pour vous amuser, sans but précis."
|
||||
Title.E text="Jeu libre"
|
||||
Resume.E text="Construisez quelques bâtiments et robots, juste pour vous amuser, sans but précis."
|
||||
Resume.E text="Construisez quelques bâtiments et robots, juste pour vous amuser, sans but précis."
|
||||
Instructions name="fglobal.txt"
|
||||
HelpFile name="cbot.txt"
|
||||
EndingFile win=-1 lost=-1
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Title.F text="Jeu libre"
|
||||
Resume.F text="Construisez quelques bâtiments et robots, juste pour vous amuser, sans but précis."
|
||||
Resume.F text="Construisez quelques bâtiments et robots, juste pour vous amuser, sans but précis."
|
||||
Title.E text="Jeu libre"
|
||||
Resume.E text="Construisez quelques bâtiments et robots, juste pour vous amuser, sans but précis."
|
||||
Resume.E text="Construisez quelques bâtiments et robots, juste pour vous amuser, sans but précis."
|
||||
Instructions name="fglobal.txt"
|
||||
HelpFile name="cbot.txt"
|
||||
EndingFile win=-1 lost=-1
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
Title.F text="Suivre un chemin"
|
||||
Resume.F text="Déplacer un robot le long d'une trajectoire donnée."
|
||||
Resume.F text="Déplacer un robot le long d'une trajectoire donnée."
|
||||
Title.E text="Suivre un chemin"
|
||||
Resume.E text="Déplacer un robot le long d'une trajectoire donnée."
|
||||
ScriptName text="Déplace"
|
||||
Resume.E text="Déplacer un robot le long d'une trajectoire donnée."
|
||||
ScriptName text="Déplace"
|
||||
Instructions name="dmove1.txt" immediat=1
|
||||
HelpFile name="cbot.txt"
|
||||
EndingFile win=1 lost=0
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Title.F text="Massacre"
|
||||
Resume.F text="Détruire quatre cibles à l'aide d'une boucle."
|
||||
Resume.F text="Détruire quatre cibles à l'aide d'une boucle."
|
||||
Title.E text="Massacre"
|
||||
Resume.E text="Détruire quatre cibles à l'aide d'une boucle."
|
||||
Resume.E text="Détruire quatre cibles à l'aide d'une boucle."
|
||||
ScriptName text="Go"
|
||||
Instructions name="dfor.txt" immediat=1
|
||||
HelpFile name="cbot.txt"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Title.F text="Bornes"
|
||||
Resume.F text="Récolter des informations de direction et de distance."
|
||||
Resume.F text="Récolter des informations de direction et de distance."
|
||||
Title.E text="Bornes"
|
||||
Resume.E text="Récolter des informations de direction et de distance."
|
||||
Resume.E text="Récolter des informations de direction et de distance."
|
||||
ScriptName text="Suivre"
|
||||
Instructions name="dexch1.txt" immediat=1
|
||||
HelpFile name="cbot.txt"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Title.F text="Le petit poucet"
|
||||
Resume.F text="Utilisez le radar pour trouver toutes les marques déposées par le petit poucet."
|
||||
Resume.F text="Utilisez le radar pour trouver toutes les marques déposées par le petit poucet."
|
||||
Title.E text="Le petit poucet"
|
||||
Resume.E text="Utilisez le radar pour trouver toutes les marques déposées par le petit poucet."
|
||||
Resume.E text="Utilisez le radar pour trouver toutes les marques déposées par le petit poucet."
|
||||
ScriptName text="Ramasse"
|
||||
Instructions name="dradar1.txt" immediat=1
|
||||
HelpFile name="cbot.txt"
|
||||
|
@ -69,7 +69,7 @@ CreateObject pos=36.25;-67.50 dir=1.0 type=Me option=2
|
|||
CreateObject pos=32.50;-65.00 dir=1.0 type=PracticeBot reset=1 trainer=1 soluce="tradar1.txt" select=1
|
||||
CreateObject pos=20.00;-77.50 dir=1.0 type=WheeledSniffer reset=1 script1="tradar2.txt" run=1
|
||||
|
||||
// Ligne supérieure.
|
||||
// Ligne supérieure.
|
||||
CreateObject pos= 7.50;-62.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=12.50;-62.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=17.50;-62.50 dir=0.0 type=Barrier1
|
||||
|
@ -77,7 +77,7 @@ CreateObject pos=22.50;-62.50 dir=0.0 type=Barrier1
|
|||
CreateObject pos=27.50;-62.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=32.50;-62.50 dir=0.0 type=Barrier1
|
||||
|
||||
// Ligne inférieure.
|
||||
// Ligne inférieure.
|
||||
CreateObject pos= 7.50;-92.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=12.50;-92.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=17.50;-92.50 dir=0.0 type=Barrier1
|
||||
|
|
|
@ -70,7 +70,7 @@ CreateObject pos=36.25;-67.50 dir=1.0 type=Me option=2
|
|||
CreateObject pos=32.50;-65.00 dir=1.0 type=PracticeBot reset=1 trainer=1 soluce="tfollow1.txt" select=1
|
||||
CreateObject pos=20.00;-77.50 dir=1.0 type=TargetBot reset=1 script1="tfollow2.txt" run=1
|
||||
|
||||
// Ligne supérieure.
|
||||
// Ligne supérieure.
|
||||
CreateObject pos= 7.50;-62.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=12.50;-62.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=17.50;-62.50 dir=0.0 type=Barrier1
|
||||
|
@ -78,7 +78,7 @@ CreateObject pos=22.50;-62.50 dir=0.0 type=Barrier1
|
|||
CreateObject pos=27.50;-62.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=32.50;-62.50 dir=0.0 type=Barrier1
|
||||
|
||||
// Ligne inférieure.
|
||||
// Ligne inférieure.
|
||||
CreateObject pos= 7.50;-92.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=12.50;-92.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=17.50;-92.50 dir=0.0 type=Barrier1
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Title.F text="Au secours"
|
||||
Resume.F text="Défendez-vous de toutes les attaques ennemies."
|
||||
Resume.F text="Défendez-vous de toutes les attaques ennemies."
|
||||
Title.E text="Au secours"
|
||||
Resume.E text="Défendez-vous de toutes les attaques ennemies."
|
||||
Resume.E text="Défendez-vous de toutes les attaques ennemies."
|
||||
ScriptName text="Protect"
|
||||
Instructions name="dhelp1.txt" immediat=1
|
||||
HelpFile name="cbot.txt"
|
||||
|
@ -79,13 +79,13 @@ CreateObject pos= 36.00;-150.00 dir=1.0 type=AlienAnt reset=1 script1="tprot1a.
|
|||
CreateObject pos= 89.00; -29.00 dir=1.0 type=AlienAnt reset=1 script1="tprot1a.txt" run=1
|
||||
CreateObject pos= -30.00;-100.00 dir=1.0 type=AlienAnt reset=1 script1="tprot1a.txt" run=1
|
||||
|
||||
// Ligne supérieure.
|
||||
// Ligne supérieure.
|
||||
CreateObject pos=12.50;-67.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=17.50;-67.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=22.50;-67.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=27.50;-67.50 dir=0.0 type=Barrier1
|
||||
|
||||
// Ligne inférieure.
|
||||
// Ligne inférieure.
|
||||
CreateObject pos=12.50;-87.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=17.50;-87.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=22.50;-87.50 dir=0.0 type=Barrier1
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Title.F text="Radar et pièges 1"
|
||||
Resume.F text="Utilisez le radar pour trouver des objets répartis aléatoirement, en évitant les bombes."
|
||||
Title.E text="Radar et pièges 1"
|
||||
Resume.E text="Utilisez le radar pour trouver des objets répartis aléatoirement, en évitant les bombes."
|
||||
Title.F text="Radar et pièges 1"
|
||||
Resume.F text="Utilisez le radar pour trouver des objets répartis aléatoirement, en évitant les bombes."
|
||||
Title.E text="Radar et pièges 1"
|
||||
Resume.E text="Utilisez le radar pour trouver des objets répartis aléatoirement, en évitant les bombes."
|
||||
ScriptName text="Cherche"
|
||||
Instructions name="dtrap1.txt" immediat=1
|
||||
HelpFile name="cbot.txt"
|
||||
|
@ -68,7 +68,7 @@ BeginObject
|
|||
CreateObject pos=36.25;-67.50 dir=1.0 type=Me option=2
|
||||
CreateObject pos=32.50;-65.00 dir=1.0 type=PracticeBot reset=1 trainer=1 soluce="ttrap1.txt" select=1
|
||||
|
||||
// Ligne supérieure.
|
||||
// Ligne supérieure.
|
||||
CreateObject pos= 7.50;-62.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=12.50;-62.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=17.50;-62.50 dir=0.0 type=Barrier1
|
||||
|
@ -76,7 +76,7 @@ CreateObject pos=22.50;-62.50 dir=0.0 type=Barrier1
|
|||
CreateObject pos=27.50;-62.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=32.50;-62.50 dir=0.0 type=Barrier1
|
||||
|
||||
// Ligne inférieure.
|
||||
// Ligne inférieure.
|
||||
CreateObject pos= 7.50;-92.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=12.50;-92.50 dir=0.0 type=Barrier1
|
||||
CreateObject pos=17.50;-92.50 dir=0.0 type=Barrier1
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Title.F text="Radar et pièges 2"
|
||||
Title.F text="Radar et pièges 2"
|
||||
Resume.F text="A vous d'imaginer comment survivre dans un milieu hostile."
|
||||
Title.E text="Radar et pièges 2"
|
||||
Title.E text="Radar et pièges 2"
|
||||
Resume.E text="A vous d'imaginer comment survivre dans un milieu hostile."
|
||||
ScriptName text="Cherche"
|
||||
Instructions name="dtrap2.txt" immediat=1
|
||||
|
@ -68,7 +68,7 @@ BeginObject
|
|||
CreateObject pos=37.50;-65.00 dir=1.0 type=Me option=2
|
||||
CreateObject pos=32.50;-65.00 dir=1.0 type=PracticeBot reset=1 trainer=1 soluce="ttrap2.txt" power=1 select=1
|
||||
|
||||
// Ligne supérieure.
|
||||
// Ligne supérieure.
|
||||
CreateObject pos= 7.50;-62.50 dir=0.0 type=Mine
|
||||
CreateObject pos=10.00;-62.50 dir=0.0 type=Mine
|
||||
CreateObject pos=12.50;-62.50 dir=0.0 type=Mine
|
||||
|
@ -81,7 +81,7 @@ CreateObject pos=27.50;-62.50 dir=0.0 type=Mine
|
|||
CreateObject pos=30.00;-62.50 dir=0.0 type=Mine
|
||||
CreateObject pos=32.50;-62.50 dir=0.0 type=Mine
|
||||
|
||||
// Ligne inférieure.
|
||||
// Ligne inférieure.
|
||||
CreateObject pos= 7.50;-92.50 dir=0.0 type=Mine
|
||||
CreateObject pos=10.00;-92.50 dir=0.0 type=Mine
|
||||
CreateObject pos=12.50;-92.50 dir=0.0 type=Mine
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Title.F text="Déplacements" resume="Déplace"
|
||||
Title.F text="Déplacements" resume="Déplace"
|
||||
Title.E text="Movings" resume="Move"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
Title.F text="Le déménageur 1"
|
||||
Resume.F text="Déplacer du minerai pour le convertir en métal."
|
||||
Title.E text="Le déménageur 1"
|
||||
Resume.E text="Déplacer du minerai pour le convertir en métal."
|
||||
ScriptName text="Déplace"
|
||||
Title.F text="Le déménageur 1"
|
||||
Resume.F text="Déplacer du minerai pour le convertir en métal."
|
||||
Title.E text="Le déménageur 1"
|
||||
Resume.E text="Déplacer du minerai pour le convertir en métal."
|
||||
ScriptName text="Déplace"
|
||||
Instructions name="dremova1.txt" immediat=1
|
||||
HelpFile name="cbot.txt"
|
||||
EndingFile win=1 lost=0
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
Title.F text="Le déménageur 2"
|
||||
Resume.F text="Déplacer un cube de métal par dessus des obstacles."
|
||||
Title.E text="Le déménageur 2"
|
||||
Resume.E text="Déplacer un cube de métal par dessus des obstacles."
|
||||
ScriptName text="Déplace"
|
||||
Title.F text="Le déménageur 2"
|
||||
Resume.F text="Déplacer un cube de métal par dessus des obstacles."
|
||||
Title.E text="Le déménageur 2"
|
||||
Resume.E text="Déplacer un cube de métal par dessus des obstacles."
|
||||
ScriptName text="Déplace"
|
||||
Instructions name="dremova2.txt" immediat=1
|
||||
HelpFile name="cbot.txt"
|
||||
EndingFile win=1 lost=0
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue