Mini projet LOO

Dependencies:   mbed APDS_9960 mbed-rtos

Dependents:   MoveYourTetris_OK

Home du projet

Revision:
12:7afdbc7465ac
Parent:
11:c37922a0a915
Child:
20:921ffec1acb4
diff -r c37922a0a915 -r 7afdbc7465ac src/cEl.cpp
--- a/src/cEl.cpp	Sun Apr 10 17:46:03 2016 +0000
+++ b/src/cEl.cpp	Sun Apr 10 20:51:02 2016 +0000
@@ -19,15 +19,20 @@
     _Leds[2].setPositionY(_positionY);
     _Leds[3].setPositionX(_positionX + 1);
     _Leds[3].setPositionY(_positionY);
-
+    for(unsigned char i = 0; i<4; i++) {
+        _Leds[i].setOldPositionX(_Leds[i].getPositionX());
+    }
+    for(unsigned char i = 0; i<4; i++) {
+        _Leds[i].setOldPositionY(_Leds[i].getPositionY());
+    }
+    _typeForme = 4;
 }
 
 cEl::cEl(unsigned char x, unsigned char y)
 {
     // variables à 0
     _positionX = x;
-    _positionY = y;
-    
+    _positionY = y;    
     _orientation = 1;
     // Positionnement des leds
     //  |1|2|3|
@@ -40,20 +45,15 @@
     _Leds[2].setPositionY(_positionY);
     _Leds[3].setPositionX(_positionX + 1);
     _Leds[3].setPositionY(_positionY);
-       for(unsigned char i = 0; i<4;i++)
-    {
-    _Leds[i].setOldPositionX(_Leds[i].getPositionX());
+    for(unsigned char i = 0; i<4; i++) {
+        _Leds[i].setOldPositionX(_Leds[i].getPositionX());
     }
-    for(unsigned char i = 0; i<4;i++)
-    {
-    _Leds[i].setOldPositionY(_Leds[i].getPositionY());
+    for(unsigned char i = 0; i<4; i++) {
+        _Leds[i].setOldPositionY(_Leds[i].getPositionY());
     }
-        ////////////////////////////////////////////////////////
-        _typeForme = 4;
+    _typeForme = 4;
 }
 
-
-
 void cEl::rotationHoraire()
 {
     // Sauvegarde des anciennes positions
@@ -126,4 +126,3 @@
             break;
     }
 }
-