Entrega 1 de tetris

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Mateom0104
Date:
Sun Oct 14 03:37:00 2018 +0000
Parent:
1:df74ebfc1126
Commit message:
TETRIS ARREGLADO

Changed in this revision

datos.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r df74ebfc1126 -r 2ca73be1a865 datos.h
--- a/datos.h	Thu Sep 13 20:42:04 2018 +0000
+++ b/datos.h	Sun Oct 14 03:37:00 2018 +0000
@@ -4,6 +4,7 @@
 int tamano;
 int posicion;
 int posicion_original;
+int verificar2;
 void start0()
 {
   int i;
@@ -163,6 +164,7 @@
          start[posicion-1]=0b00100000;
          start[posicion-0]=0b11100000;
          tamano=2;
+         verificar2=1;
         break;
         
         
@@ -205,6 +207,7 @@
          start[posicion-1]=0b11100000;
          start[posicion-0]=0b00100000;
          tamano=2;
+         verificar2=1;
         break;
         
         
diff -r df74ebfc1126 -r 2ca73be1a865 main.cpp
--- a/main.cpp	Thu Sep 13 20:42:04 2018 +0000
+++ b/main.cpp	Sun Oct 14 03:37:00 2018 +0000
@@ -12,7 +12,7 @@
 uint8_t verifica;
 uint8_t mascara;
 int velocidad=70;
-
+int segundo=1;
 
 ///////////////////////////////////////////////////////////////////////////////
 void sendSPI(uint8_t d1, uint8_t d2)// envio de datos al max
@@ -71,7 +71,7 @@
      
      for(i=0;i<tamano;i++)
      {
-         screen[posicion-i]=((((screen[posicion-i]>>1) & ~(mascara-1)) | (screen[posicion-i] & (mascara-1))) | screen2[posicion-i] ) | (screen[posicion-i] & mascara);
+         screen[posicion-i]=((((screen[posicion-i]>>1) & ~(mascara-1)) | (screen[posicion-i] & (mascara-1))) | screen2[posicion-i] ) | (screen[posicion-i] & mascara) | (screen[posicion-i] & mascara*segundo);
      }    
      
      //pc.printf("2 \n");
@@ -131,9 +131,17 @@
             {
              i=tamano;
              verifica=1;
+             segundo=1;
+             if(verificar2==1)
+             {
+                 verificar2=0;
+                 verifica=0;
+                 segundo=2;
+             }   
             }  
             else
             {
+             segundo=1;
              verifica=0;     
             }
        }