Time is good

Dependencies:   RoboClaw mbed

Fork of Robot2016_2-0 by ARES

Committer:
IceTeam
Date:
Thu May 05 01:30:14 2016 +0200
Revision:
64:24e1057a97f7
Parent:
63:176d04975f06
Child:
65:7bf11abfefc3
Test du code d'execution des objectifs et des nouvelles fonctionnalites du path finding

Who changed what in which revision?

UserRevisionLine numberNew contents of line
IceTeam 47:be4eebf40568 1 #include "map.h"
IceTeam 47:be4eebf40568 2
IceTeam 57:86f491f5b25d 3 /* Dernier Changement : Romain 20h30 */
IceTeam 57:86f491f5b25d 4
IceTeam 64:24e1057a97f7 5 void map::Build_Objectives() {
IceTeam 64:24e1057a97f7 6 if (couleur == VERT) {
IceTeam 64:24e1057a97f7 7 addObj (objectif (OBJ_BLOC, 120, 1000, 0, Parasol, pince));
IceTeam 64:24e1057a97f7 8 addObj (objectif (OBJ_BLOC, 120, 1000, 0, Parasol, pince, 10));
IceTeam 64:24e1057a97f7 9 }
IceTeam 64:24e1057a97f7 10 else {
IceTeam 64:24e1057a97f7 11 addObj (objectif (OBJ_BLOC, 3000-120, 1000, 0, Parasol, pince));
IceTeam 64:24e1057a97f7 12 addObj (objectif (OBJ_BLOC, 3000-120, 1000, 0, Parasol, pince));
IceTeam 64:24e1057a97f7 13 }
IceTeam 64:24e1057a97f7 14 }
IceTeam 64:24e1057a97f7 15
IceTeam 64:24e1057a97f7 16 map::map (Odometry* nodo, AX12 * np, ControlleurPince * npince, int ncouleur, int nformation) : Codo(nodo), Parasol(np), ControlleurPince(npince) {
IceTeam 64:24e1057a97f7 17 couleur = ncouleur;
IceTeam 64:24e1057a97f7 18 formation = nformation;
IceTeam 64:24e1057a97f7 19
IceTeam 64:24e1057a97f7 20 if (couleur == VERT) {
IceTeam 64:24e1057a97f7 21 Codo->setPos(X_START_VERT, Y_START, 0);
IceTeam 64:24e1057a97f7 22 }
IceTeam 64:24e1057a97f7 23 else {
IceTeam 64:24e1057a97f7 24 Codo->setPos(Y_START, Y_START, -PI);
IceTeam 64:24e1057a97f7 25 }
IceTeam 47:be4eebf40568 26 }
IceTeam 47:be4eebf40568 27
IceTeam 47:be4eebf40568 28 void map::addObs (obsCarr nobs) {
IceTeam 47:be4eebf40568 29 obs.push_back (nobs);
IceTeam 47:be4eebf40568 30 }
IceTeam 60:8d2320a54a32 31 void map::addObj (objectif nobj) {
IceTeam 60:8d2320a54a32 32 objectifs.push_back(nobj);
IceTeam 60:8d2320a54a32 33 }
IceTeam 47:be4eebf40568 34
IceTeam 47:be4eebf40568 35 void map::FindWay (float depX, float depY, float arrX, float arrY) {
IceTeam 47:be4eebf40568 36 point depart(depX, depY);
IceTeam 47:be4eebf40568 37 point arrivee(arrX, arrY);
IceTeam 47:be4eebf40568 38 FindWay(depart, arrivee);
IceTeam 47:be4eebf40568 39 }
IceTeam 47:be4eebf40568 40
IceTeam 47:be4eebf40568 41 void map::FindWay (point dep, point arr) {
IceTeam 47:be4eebf40568 42 //logger.printf("On a cherche un chemin\n\r");
IceTeam 47:be4eebf40568 43 nVector<pointParcours> open;
IceTeam 47:be4eebf40568 44 nVector<pointParcours> close;
IceTeam 47:be4eebf40568 45 points4 tmp;
IceTeam 47:be4eebf40568 46 bool val[4] = {true,true,true,true};
IceTeam 47:be4eebf40568 47 int os = obs.size ();
IceTeam 47:be4eebf40568 48 int i, j;
IceTeam 47:be4eebf40568 49 bool ended=false; // On teste tous les points ajoutes dans l'open list pour savoir s'il y a intersection avec un obstacle. Ended passe à true quand aucun ne coupe un obstacle.
IceTeam 47:be4eebf40568 50 endedParc = false;
IceTeam 47:be4eebf40568 51
IceTeam 47:be4eebf40568 52 path.clear();
IceTeam 47:be4eebf40568 53
IceTeam 47:be4eebf40568 54 pointParcours depP (dep, NULL, arr);
IceTeam 47:be4eebf40568 55 int indTMP1=0; // Le point actuel
IceTeam 47:be4eebf40568 56 int PointEnding = 0;
IceTeam 47:be4eebf40568 57 open.push_back (depP);
IceTeam 47:be4eebf40568 58
IceTeam 47:be4eebf40568 59 while (!ended && !open.empty ()) {
IceTeam 47:be4eebf40568 60 for (i = 0; i < open.size (); ++i) {
IceTeam 47:be4eebf40568 61 if (open[i].getP2 () < open[indTMP1].getP2 ())
IceTeam 47:be4eebf40568 62 indTMP1 = i;
IceTeam 47:be4eebf40568 63 }
IceTeam 47:be4eebf40568 64
IceTeam 47:be4eebf40568 65 close.push_first (open[indTMP1]);
IceTeam 47:be4eebf40568 66 open.erase (indTMP1);
IceTeam 47:be4eebf40568 67 indTMP1 = 0;
IceTeam 47:be4eebf40568 68
IceTeam 47:be4eebf40568 69 ended = true;
IceTeam 47:be4eebf40568 70 for (i = 0; i < os; ++i) {
IceTeam 47:be4eebf40568 71 if (obs[i].getCroisement (close[indTMP1].getX (), close[indTMP1].getY (), arr)) {
IceTeam 47:be4eebf40568 72 ended = false;
IceTeam 47:be4eebf40568 73 tmp = obs[i].getPoints ();
IceTeam 47:be4eebf40568 74
IceTeam 56:4fd9636dfb36 75 // On vérifie si le point est sur la table
IceTeam 56:4fd9636dfb36 76 if (tmp.p0.getX() < min_x_table || tmp.p0.getY() < min_y_table || tmp.p0.getX() > max_x_table || tmp.p0.getY() > max_y_table)
IceTeam 56:4fd9636dfb36 77 val[0] = false;
IceTeam 47:be4eebf40568 78 // On vérifie si le point croise un obstacle
IceTeam 56:4fd9636dfb36 79 for (j = 0; j < os && val[0]; ++j)
IceTeam 47:be4eebf40568 80 if (obs[j].getCroisement (tmp.p0, close[indTMP1]))
IceTeam 47:be4eebf40568 81 val[0] = false;
IceTeam 47:be4eebf40568 82 // On vérifie si le point existe déjà dans la liste ouverte
IceTeam 56:4fd9636dfb36 83 for (j = 0; j < open.size () && val[0]; ++j) {
IceTeam 47:be4eebf40568 84 if (open[j] == tmp.p0)
IceTeam 47:be4eebf40568 85 val[0] = false;
IceTeam 47:be4eebf40568 86 }
IceTeam 47:be4eebf40568 87 // On vérifie si le point existe déjà dans la liste fermée
IceTeam 56:4fd9636dfb36 88 for (j = 0; j < close.size () && val[0]; ++j) {
IceTeam 47:be4eebf40568 89 if (close[j] == tmp.p0)
IceTeam 47:be4eebf40568 90 val[0] = false;
IceTeam 47:be4eebf40568 91 }
IceTeam 47:be4eebf40568 92 if (val[0]) {
IceTeam 47:be4eebf40568 93 open.push_back (pointParcours (tmp.p0, &close[indTMP1], arr));
IceTeam 47:be4eebf40568 94 }
IceTeam 47:be4eebf40568 95
IceTeam 47:be4eebf40568 96 // On repete l'operation pour le second point
IceTeam 56:4fd9636dfb36 97 if (tmp.p1.getX() < min_x_table || tmp.p1.getY() < min_y_table || tmp.p1.getX() > max_x_table || tmp.p1.getY() > max_y_table)
IceTeam 56:4fd9636dfb36 98 val[1] = false;
IceTeam 56:4fd9636dfb36 99 for (j = 0; j < os && val[1]; ++j)
IceTeam 47:be4eebf40568 100 if (obs[j].getCroisement (tmp.p1, close[indTMP1]))
IceTeam 47:be4eebf40568 101 val[1] = false;
IceTeam 56:4fd9636dfb36 102 for (j = 0; j < open.size () && val[1]; ++j) {
IceTeam 47:be4eebf40568 103 if (open[j] == tmp.p1)
IceTeam 47:be4eebf40568 104 val[1] = false;
IceTeam 47:be4eebf40568 105 }
IceTeam 56:4fd9636dfb36 106 for (j = 0; j < close.size () && val[1]; ++j) {
IceTeam 47:be4eebf40568 107 if (close[j] == tmp.p1)
IceTeam 47:be4eebf40568 108 val[1] = false;
IceTeam 47:be4eebf40568 109 }
IceTeam 47:be4eebf40568 110 if (val[1]) {
IceTeam 47:be4eebf40568 111 open.push_back (pointParcours (tmp.p1, &close[indTMP1], arr));
IceTeam 47:be4eebf40568 112 }
IceTeam 47:be4eebf40568 113
IceTeam 47:be4eebf40568 114 // On répète l'opération pour le troisième point
IceTeam 56:4fd9636dfb36 115 if (tmp.p2.getX() < min_x_table || tmp.p2.getY() < min_y_table || tmp.p2.getX() > max_x_table || tmp.p2.getY() > max_y_table)
IceTeam 56:4fd9636dfb36 116 val[2] = false;
IceTeam 56:4fd9636dfb36 117 for (j = 0; j < os && val[2]; ++j)
IceTeam 47:be4eebf40568 118 if (obs[j].getCroisement (tmp.p2, close[indTMP1]))
IceTeam 47:be4eebf40568 119 val[2] = false;
IceTeam 56:4fd9636dfb36 120 for (j = 0; j < open.size () && val[2]; ++j) {
IceTeam 47:be4eebf40568 121 if (open[j] == tmp.p2)
IceTeam 47:be4eebf40568 122 val[2] = false;
IceTeam 47:be4eebf40568 123 }
IceTeam 56:4fd9636dfb36 124 for (j = 0; j < close.size () && val[2]; ++j) {
IceTeam 47:be4eebf40568 125 if (close[j] == tmp.p2)
IceTeam 47:be4eebf40568 126 val[2] = false;
IceTeam 47:be4eebf40568 127 }
IceTeam 47:be4eebf40568 128 if (val[2]) {
IceTeam 47:be4eebf40568 129 open.push_back (pointParcours (tmp.p2, &close[indTMP1], arr));
IceTeam 47:be4eebf40568 130 }
IceTeam 47:be4eebf40568 131
IceTeam 47:be4eebf40568 132 // On répète l'opération pour le quatrieme point
IceTeam 56:4fd9636dfb36 133 if (tmp.p3.getX() < min_x_table || tmp.p3.getY() < min_y_table || tmp.p3.getX() > max_x_table || tmp.p3.getY() > max_y_table)
IceTeam 56:4fd9636dfb36 134 val[3] = false;
IceTeam 56:4fd9636dfb36 135 for (j = 0; j < os && val[3]; ++j)
IceTeam 47:be4eebf40568 136 if (obs[j].getCroisement (tmp.p3, close[indTMP1]))
IceTeam 47:be4eebf40568 137 val[3] = false;
IceTeam 56:4fd9636dfb36 138 for (j = 0; j < open.size () && val[3]; ++j) {
IceTeam 47:be4eebf40568 139 if (open[j] == tmp.p3)
IceTeam 47:be4eebf40568 140 val[3] = false;
IceTeam 47:be4eebf40568 141 }
IceTeam 56:4fd9636dfb36 142 for (j = 0; j < close.size () && val[3]; ++j) {
IceTeam 47:be4eebf40568 143 if (close[j] == tmp.p3)
IceTeam 47:be4eebf40568 144 val[3] = false;
IceTeam 47:be4eebf40568 145 }
IceTeam 47:be4eebf40568 146 if (val[3]) {
IceTeam 47:be4eebf40568 147 open.push_back (pointParcours (tmp.p3, &close[indTMP1], arr));
IceTeam 47:be4eebf40568 148 }
IceTeam 47:be4eebf40568 149
IceTeam 47:be4eebf40568 150 val[0] = true;
IceTeam 47:be4eebf40568 151 val[1] = true;
IceTeam 47:be4eebf40568 152 val[2] = true;
IceTeam 47:be4eebf40568 153 val[3] = true;
IceTeam 47:be4eebf40568 154 }
IceTeam 47:be4eebf40568 155 }
IceTeam 47:be4eebf40568 156 }
IceTeam 47:be4eebf40568 157
IceTeam 47:be4eebf40568 158 /* L'algorithme n'est pas bon. Je devrais prendre ici le plus court chemin vers l'arrivée pour ceux qui ne sont pas bloqués, et pas un aléatoire ... */
IceTeam 47:be4eebf40568 159 if (ended) {
IceTeam 47:be4eebf40568 160 pointParcours* pente;
IceTeam 47:be4eebf40568 161 pente = &close[0];
IceTeam 47:be4eebf40568 162 while (pente != NULL) {
IceTeam 47:be4eebf40568 163 path.push_first (*pente);
IceTeam 47:be4eebf40568 164 pente = pente->getPere ();
IceTeam 47:be4eebf40568 165 }
IceTeam 47:be4eebf40568 166 path.push_back (pointParcours(arr, NULL, arr));
IceTeam 47:be4eebf40568 167 path.erase(0);
IceTeam 47:be4eebf40568 168 endedParc = true;
IceTeam 47:be4eebf40568 169 /*
IceTeam 47:be4eebf40568 170 if (path.size() > 1)
IceTeam 47:be4eebf40568 171 path.erase(0);*/
IceTeam 47:be4eebf40568 172 }
IceTeam 47:be4eebf40568 173 }
IceTeam 47:be4eebf40568 174
IceTeam 47:be4eebf40568 175 void map::Execute(float XObjectif, float YObjectif) {
IceTeam 47:be4eebf40568 176 logger.printf("Findway %f-%f -> %f-%f\n\r", Codo->getX(), Codo->getY(), XObjectif, YObjectif);
IceTeam 47:be4eebf40568 177 FindWay (Codo->getX(), Codo->getY(), XObjectif, YObjectif);
IceTeam 47:be4eebf40568 178
IceTeam 47:be4eebf40568 179 if (endedParc) {
IceTeam 47:be4eebf40568 180 //logger.printf("\n\r");
IceTeam 47:be4eebf40568 181 for (int i = 0; i < path.size (); i++) {
IceTeam 47:be4eebf40568 182 logger.printf("Goto %d/%d [%f, %f]... \n\r", i, path.size()-1, path[i].getX(), path[i].getY());
IceTeam 47:be4eebf40568 183 //the = (float) atan2((double) (p[i].gety() - odo.getY()), (double) (p[i].getx() - odo.getX()));
IceTeam 47:be4eebf40568 184 Codo->GotoXY((double)path[i].getX(), (double)path[i].getY());
IceTeam 47:be4eebf40568 185 logger.printf("Goto Fini\n\r");
IceTeam 47:be4eebf40568 186 }
IceTeam 47:be4eebf40568 187 //logger.printf("Chemin fini !\n\r");
IceTeam 47:be4eebf40568 188 }
IceTeam 47:be4eebf40568 189 else {
IceTeam 47:be4eebf40568 190 logger.printf("Chemin pas trouve ...\n\r");
IceTeam 47:be4eebf40568 191 }
IceTeam 47:be4eebf40568 192 endedParc = false;
IceTeam 57:86f491f5b25d 193 }
IceTeam 57:86f491f5b25d 194
IceTeam 60:8d2320a54a32 195 void map::Execute(int obj) {
IceTeam 57:86f491f5b25d 196 // logger.printf("Findway %f-%f -> %f-%f\n\r", Codo->getX(), Codo->getY(), XObjectif, YObjectif);
IceTeam 63:176d04975f06 197 objectif o = objectifs[obj];
IceTeam 57:86f491f5b25d 198 FindWay (Codo->getX(), Codo->getY(), o.getX(), o.getY());
IceTeam 57:86f491f5b25d 199
IceTeam 57:86f491f5b25d 200 if (endedParc) {
IceTeam 57:86f491f5b25d 201 //logger.printf("\n\r");
IceTeam 57:86f491f5b25d 202 for (int i = 0; i < path.size (); i++) {
IceTeam 57:86f491f5b25d 203 // logger.printf("Goto %d/%d [%f, %f]... \n\r", i, path.size()-1, path[i].getX(), path[i].getY());
IceTeam 57:86f491f5b25d 204 //the = (float) atan2((double) (p[i].gety() - odo.getY()), (double) (p[i].getx() - odo.getX()));
IceTeam 57:86f491f5b25d 205 Codo->GotoXY((double)path[i].getX(), (double)path[i].getY());
IceTeam 57:86f491f5b25d 206 // logger.printf("Goto Fini\n\r");
IceTeam 57:86f491f5b25d 207 }
IceTeam 63:176d04975f06 208 Codo->GotoThet(o.getThet());
IceTeam 60:8d2320a54a32 209 o.Action();
IceTeam 57:86f491f5b25d 210 //logger.printf("Chemin fini !\n\r");
IceTeam 57:86f491f5b25d 211 }
IceTeam 57:86f491f5b25d 212 else {
IceTeam 57:86f491f5b25d 213 logger.printf("Chemin pas trouve ...\n\r");
IceTeam 57:86f491f5b25d 214 }
IceTeam 57:86f491f5b25d 215 endedParc = false;
IceTeam 60:8d2320a54a32 216 }
IceTeam 60:8d2320a54a32 217
IceTeam 64:24e1057a97f7 218 void map::Execute() {
IceTeam 64:24e1057a97f7 219 for (int i = 0; i < objectifs.size();++i) {
IceTeam 64:24e1057a97f7 220 Execute(i);
IceTeam 64:24e1057a97f7 221 }
IceTeam 64:24e1057a97f7 222 }
IceTeam 64:24e1057a97f7 223
IceTeam 60:8d2320a54a32 224 void map::Build (int couleur, int formation) {
IceTeam 60:8d2320a54a32 225 if (couleur == VERT) {
IceTeam 60:8d2320a54a32 226 max_x_table = 1400;
IceTeam 64:24e1057a97f7 227 max_y_table = 1900;
IceTeam 64:24e1057a97f7 228 min_x_table = 100;
IceTeam 64:24e1057a97f7 229 min_y_table = 100;
IceTeam 60:8d2320a54a32 230 }
IceTeam 60:8d2320a54a32 231 else {
IceTeam 60:8d2320a54a32 232 max_x_table = 2900;
IceTeam 64:24e1057a97f7 233 max_y_table = 1900;
IceTeam 60:8d2320a54a32 234 min_x_table = 1600;
IceTeam 64:24e1057a97f7 235 min_y_table = 100;
IceTeam 60:8d2320a54a32 236 }
IceTeam 60:8d2320a54a32 237
IceTeam 63:176d04975f06 238 if (couleur == VERT) {
IceTeam 64:24e1057a97f7 239 // Attention les commentaires sont inversées par rapport aux valeur en x et y des obstacles.
IceTeam 64:24e1057a97f7 240 // Il faut lire les commentaires de la façon dont la carte est présentée dans le règlement
IceTeam 64:24e1057a97f7 241 // Un / signifie un point de départ. Milieu/Haut/Haut signifie que l'on part du milieu, que l'on va en haut puis encore en haut
IceTeam 64:24e1057a97f7 242
IceTeam 60:8d2320a54a32 243 addObs(obsCarr (0, 2000, 250, 150)); // Coté haut droite
IceTeam 60:8d2320a54a32 244 addObs(obsCarr (200, 2000, 200, 50));
IceTeam 64:24e1057a97f7 245
IceTeam 64:24e1057a97f7 246 addObs(obsCarr (800, 100, 100, 15)); // Petit obstacle en haut à gauche
IceTeam 60:8d2320a54a32 247 }
IceTeam 60:8d2320a54a32 248 else {
IceTeam 60:8d2320a54a32 249 addObs(obsCarr (3000, 2000, 250, 150)); // Coté bas droite
IceTeam 60:8d2320a54a32 250 addObs(obsCarr (2800, 2000, 200, 50));
IceTeam 64:24e1057a97f7 251
IceTeam 64:24e1057a97f7 252 addObs(obsCarr (2200, 100, 100, 15)); // Petit Obstacle en haut à gauche
IceTeam 60:8d2320a54a32 253 }
IceTeam 60:8d2320a54a32 254
IceTeam 64:24e1057a97f7 255 addObs(obsCarr (1500, 750, 1100, 15)); // Obstacle du milieu à la verticale
IceTeam 64:24e1057a97f7 256 addObs(obsCarr (1500, 1050, 20, 300)); // Vitre du milieu (horizontale)
IceTeam 60:8d2320a54a32 257
IceTeam 60:8d2320a54a32 258 if (formation == 1) {
IceTeam 60:8d2320a54a32 259 Build_formation_1 (couleur);
IceTeam 60:8d2320a54a32 260 }
IceTeam 64:24e1057a97f7 261 if (formation == 2) {
IceTeam 64:24e1057a97f7 262 Build_formation_2 (couleur);
IceTeam 64:24e1057a97f7 263 }
IceTeam 60:8d2320a54a32 264 else {
IceTeam 64:24e1057a97f7 265 addObs(obsCarr (1250, 1000, 220, 220)); // Obstacles du test standard hors-coupe. A ignorer
IceTeam 60:8d2320a54a32 266 addObs(obsCarr (1500, 750, 220, 220));
IceTeam 60:8d2320a54a32 267 addObs(obsCarr (1500, 1250, 220, 220));
IceTeam 60:8d2320a54a32 268 }
IceTeam 60:8d2320a54a32 269 }
IceTeam 60:8d2320a54a32 270
IceTeam 60:8d2320a54a32 271 void map::Build_formation_1 (int couleur) {
IceTeam 60:8d2320a54a32 272 if (couleur == VERT) {
IceTeam 64:24e1057a97f7 273 addObs(obsCarr (200, 2000-450, 40, 40)); // Coquillage du haut - droite
IceTeam 64:24e1057a97f7 274 addObs(obsCarr (200, 2000-750, 40, 40)); // Coquillage sur le même axe horizontal
IceTeam 60:8d2320a54a32 275
IceTeam 64:24e1057a97f7 276 addObs(obsCarr (900, 2000-550, 40, 40)); // Coqullage du milieu/haut/haut
IceTeam 64:24e1057a97f7 277 addObs(obsCarr (1200, 2000-350, 40, 40)); // Coquillage du milieu/haut
IceTeam 60:8d2320a54a32 278
IceTeam 64:24e1057a97f7 279 addObs(obsCarr (1500, 2000-550, 40, 40)); // Coquillage du milieu gauche
IceTeam 64:24e1057a97f7 280 addObs(obsCarr (1500, 2000-350, 40, 40)); // Coquillage du milieu droit
IceTeam 60:8d2320a54a32 281
IceTeam 60:8d2320a54a32 282 //addObs(obsCarr (3000-900, 2000-550, 40, 40));
IceTeam 64:24e1057a97f7 283 addObs(obsCarr (3000-1200, 2000-350, 40, 40)); // Coquillage du milieu bas
IceTeam 60:8d2320a54a32 284
IceTeam 60:8d2320a54a32 285 //addObs(obsCarr (3000-200, 2000-450, 40, 40)); // Coquillages du bas droite
IceTeam 60:8d2320a54a32 286 //addObs(obsCarr (3000-200, 2000-750, 40, 40));
IceTeam 60:8d2320a54a32 287 }
IceTeam 60:8d2320a54a32 288 else {
IceTeam 60:8d2320a54a32 289 //addObs(obsCarr (200, 2000-450, 40, 40)); // Coquillages du haut droit
IceTeam 60:8d2320a54a32 290 //addObs(obsCarr (200, 2000-750, 40, 40));
IceTeam 60:8d2320a54a32 291
IceTeam 60:8d2320a54a32 292 //addObs(obsCarr (900, 2000-550, 40, 40));
IceTeam 60:8d2320a54a32 293 addObs(obsCarr (1200, 2000-350, 40, 40)); // Coquillages du milieu/haut
IceTeam 60:8d2320a54a32 294
IceTeam 64:24e1057a97f7 295 addObs(obsCarr (1500, 2000-550, 40, 40)); // Coquillage du milieu gauche
IceTeam 64:24e1057a97f7 296 addObs(obsCarr (1500, 2000-350, 40, 40)); // Coquillage du milieu droite
IceTeam 60:8d2320a54a32 297
IceTeam 64:24e1057a97f7 298 addObs(obsCarr (3000-900, 2000-550, 40, 40)); // Coquillage du milieu/bas
IceTeam 64:24e1057a97f7 299 addObs(obsCarr (3000-1200, 2000-350, 40, 40)); // Coquillage du milieu/bas/bas
IceTeam 60:8d2320a54a32 300
IceTeam 60:8d2320a54a32 301 addObs(obsCarr (3000-200, 2000-450, 40, 40)); // Coquillages du bas droite
IceTeam 64:24e1057a97f7 302 addObs(obsCarr (3000-200, 2000-750, 40, 40)); // Coquillage sur le même axe horizontal
IceTeam 60:8d2320a54a32 303 }
IceTeam 60:8d2320a54a32 304 }
IceTeam 60:8d2320a54a32 305
IceTeam 60:8d2320a54a32 306 void map::Build_formation_2 (int couleur) {
IceTeam 60:8d2320a54a32 307 if (couleur == VERT) {
IceTeam 64:24e1057a97f7 308 addObs(obsCarr (200, 2000-450, 40, 40)); // Coquillage du haut gauche
IceTeam 64:24e1057a97f7 309 addObs(obsCarr (200, 2000-750, 40, 40)); // Coquillage du haut droite
IceTeam 60:8d2320a54a32 310
IceTeam 64:24e1057a97f7 311 addObs(obsCarr (600, 2000-450, 40, 40)); // Coquillage du milieu/haut/haut droite
IceTeam 64:24e1057a97f7 312 addObs(obsCarr (600, 2000-750, 40, 40)); // Coquillage du milieu/haut/haut sur le même axe horizontal
IceTeam 64:24e1057a97f7 313
IceTeam 64:24e1057a97f7 314 addObs(obsCarr (1200, 2000-350, 40, 40)); // Coquillage du milieu/haut droite
IceTeam 60:8d2320a54a32 315 }
IceTeam 60:8d2320a54a32 316 else {
IceTeam 60:8d2320a54a32 317 //addObs(obsCarr (200, 2000-450, 40, 40)); // Coquillages du haut droit
IceTeam 60:8d2320a54a32 318 //addObs(obsCarr (200, 2000-750, 40, 40));
IceTeam 60:8d2320a54a32 319
IceTeam 60:8d2320a54a32 320 //addObs(obsCarr (900, 2000-550, 40, 40));
IceTeam 64:24e1057a97f7 321 addObs(obsCarr (3000-200, 2000-450, 40, 40)); // Coquillage du bas gauche
IceTeam 64:24e1057a97f7 322 addObs(obsCarr (3000-200, 2000-750, 40, 40)); // Coquillage du bas droite
IceTeam 64:24e1057a97f7 323
IceTeam 64:24e1057a97f7 324 addObs(obsCarr (3000-600, 2000-450, 40, 40)); // Coquillage du milieu bas/bas droite
IceTeam 64:24e1057a97f7 325 addObs(obsCarr (3000-600, 2000-750, 40, 40)); // Coquillage du milieu bas/bas sur le même axe horizontal
IceTeam 64:24e1057a97f7 326
IceTeam 64:24e1057a97f7 327 addObs(obsCarr (1800, 2000-350, 40, 40)); // Coquillage du milieu/bas droite
IceTeam 64:24e1057a97f7 328 }
IceTeam 64:24e1057a97f7 329 }
IceTeam 64:24e1057a97f7 330
IceTeam 64:24e1057a97f7 331 void map::Build_Objectives() {
IceTeam 64:24e1057a97f7 332 if (couleur == VERT) {
IceTeam 64:24e1057a97f7 333 addObj (objectif (OBJ_BLOC, 120, 1000, 0, Parasol, pince));
IceTeam 64:24e1057a97f7 334 addObj (objectif (OBJ_BLOC, 120, 1000, 0, Parasol, pince));
IceTeam 64:24e1057a97f7 335 }
IceTeam 64:24e1057a97f7 336 else {
IceTeam 64:24e1057a97f7 337 addObj (objectif (OBJ_BLOC, 3000-120, 1000, 0, Parasol, pince));
IceTeam 64:24e1057a97f7 338 addObj (objectif (OBJ_BLOC, 3000-120, 1000, 0, Parasol, pince));
IceTeam 60:8d2320a54a32 339 }
IceTeam 47:be4eebf40568 340 }