Mini projet LOO

Dependencies:   mbed APDS_9960 mbed-rtos

Dependents:   MoveYourTetris_OK

Home du projet

Committer:
Willheisen
Date:
Wed Apr 06 15:41:24 2016 +0000
Revision:
8:92d0c4961a16
Parent:
7:4b283e36b147
Child:
12:7afdbc7465ac
ajout de la classe cJeu avec les m?thodes initialiser et g?n?ration al?atoire de pi?ce

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Willheisen 3:493dd1cf30a4 1 // Définition de la classe Carré
Willheisen 3:493dd1cf30a4 2
Willheisen 3:493dd1cf30a4 3 #include "cZed.h"
Willheisen 3:493dd1cf30a4 4
clementdoreau 7:4b283e36b147 5 cZed::cZed() {
clementdoreau 7:4b283e36b147 6 // variables à 0
clementdoreau 7:4b283e36b147 7 _positionX = 0;
clementdoreau 7:4b283e36b147 8 _positionY = 0;
clementdoreau 7:4b283e36b147 9 _orientation = 1;
clementdoreau 7:4b283e36b147 10 // Positionnement des leds
clementdoreau 7:4b283e36b147 11 // |0|1|
clementdoreau 7:4b283e36b147 12 // |2|3|
clementdoreau 7:4b283e36b147 13 _Leds[0].setPositionX(_positionX); // Led coin haut gauche
clementdoreau 7:4b283e36b147 14 _Leds[0].setPositionY(_positionY); // Led coin haut gauche
clementdoreau 7:4b283e36b147 15 _Leds[1].setPositionX(_positionX + 1);
clementdoreau 7:4b283e36b147 16 _Leds[1].setPositionY(_positionY);
clementdoreau 7:4b283e36b147 17 _Leds[2].setPositionX(_positionX + 1);
clementdoreau 7:4b283e36b147 18 _Leds[2].setPositionY(_positionY + 1);
clementdoreau 7:4b283e36b147 19 _Leds[3].setPositionX(_positionX + 2);
clementdoreau 7:4b283e36b147 20 _Leds[3].setPositionY(_positionY + 1);
Willheisen 3:493dd1cf30a4 21
Willheisen 3:493dd1cf30a4 22 }
Willheisen 3:493dd1cf30a4 23
clementdoreau 7:4b283e36b147 24 cZed::cZed(unsigned char x, unsigned char y) {
clementdoreau 7:4b283e36b147 25 // variables à 0
clementdoreau 7:4b283e36b147 26 _positionX = x;
clementdoreau 7:4b283e36b147 27 _positionY = y;
clementdoreau 7:4b283e36b147 28 _orientation = 1;
clementdoreau 7:4b283e36b147 29 // Positionnement des leds
clementdoreau 7:4b283e36b147 30 // |0|1|
clementdoreau 7:4b283e36b147 31 // |2|3|
clementdoreau 7:4b283e36b147 32 _Leds[0].setPositionX(_positionX); // Led coin haut gauche
clementdoreau 7:4b283e36b147 33 _Leds[0].setPositionY(_positionY); // Led coin haut gauche
clementdoreau 7:4b283e36b147 34 _Leds[1].setPositionX(_positionX + 1);
clementdoreau 7:4b283e36b147 35 _Leds[1].setPositionY(_positionY);
clementdoreau 7:4b283e36b147 36 _Leds[2].setPositionX(_positionX + 1);
clementdoreau 7:4b283e36b147 37 _Leds[2].setPositionY(_positionY + 1);
clementdoreau 7:4b283e36b147 38 _Leds[3].setPositionX(_positionX + 2);
clementdoreau 7:4b283e36b147 39 _Leds[3].setPositionY(_positionY + 1);
Willheisen 3:493dd1cf30a4 40 }
Willheisen 3:493dd1cf30a4 41
Willheisen 3:493dd1cf30a4 42
clementdoreau 7:4b283e36b147 43 void cZed::rotationHoraire() {
clementdoreau 7:4b283e36b147 44
clementdoreau 7:4b283e36b147 45 }