Dependencies:   mbed

Revision:
11:7a4abe731f9c
Parent:
10:df6a496270be
Child:
12:299479b6bb59
--- a/StartMenu/StartMenu.cpp	Thu May 21 12:51:46 2020 +0000
+++ b/StartMenu/StartMenu.cpp	Mon May 25 16:40:59 2020 +0000
@@ -31,15 +31,14 @@
         
     lcd.clear();
     lcd.printString("  Start Game  ",0,1);
-    lcd.printString("  Levels      ",0,2);
-    lcd.printString("  Tutorial    ",0,3);
+    lcd.printString("  How to play ",0,2);
     lcd.drawSprite(5,selector * 8,7,5,(int *)arrow);
     lcd.refresh();
         
         wait(0.15);
         
         if( pad.get_direction() == S ){
-            if( selector < 3 ){
+            if( selector < 2 ){
             selector ++;
             }
         }
@@ -53,67 +52,36 @@
         imposs.set_level_one();
     }
     if( selector == 2 ){
-        level(pad,lcd);
-    }
-    if( selector == 3 ){
+        wait(0.15);
+        while(pad.A_pressed() == false){
+            lcd.clear();
+            lcd.printString("Use the       ",0,0);
+            lcd.printString("joystick to   ",0,1);
+            lcd.printString("move the ball.",0,2);
+            lcd.drawSprite(70,40,7,5,(int *)arrow);
+            lcd.refresh();
+            }
+        while(pad.A_pressed() == false){
+            wait(0.15);
+            lcd.clear();
+            lcd.printString("Press A to    ",0,0);
+            lcd.printString("double your   ",0,1);
+            lcd.printString("speed!        ",0,2);
+            lcd.drawSprite(70,40,7,5,(int *)arrow);
+            lcd.refresh();
+            }
+        while(pad.A_pressed() == false){
+            wait(0.15);
+            lcd.clear();
+            lcd.printString("Touch a wall  ",0,0);
+            lcd.printString("and you fail! ",0,1);
+            lcd.printString("There are 5   ",0,2);
+            lcd.printString("levels.       ",0,3);
+            lcd.printString("Good luck!    ",0,4);
+            lcd.drawSprite(70,40,7,5,(int *)arrow);
+            lcd.refresh();
+            }
         imposs.set_level_zero();
     }
        
   }
-
-
-void StartMenu::level(Gamepad &pad,N5110 &lcd)
-{
-     
-     ImpossEngine imposs;
-     
-     int selector = 1;
-     
-     int arrow[7][5] = {
-        {0,0,0,0,0},
-        {1,1,0,0,0},
-        {1,1,1,1,0},
-        {1,1,1,1,1},
-        {1,1,1,1,0},
-        {1,1,0,0,0},
-        {0,0,0,0,0},
-     };
-     
-     while( pad.A_pressed() == false ){
-        
-    lcd.clear();
-    lcd.printString("  Level 1    ",0,1);
-    lcd.printString("  Level 2    ",0,2);
-    lcd.printString("  Level 3    ",0,3);
-    lcd.printString("  Level 4    ",0,4);
-    lcd.drawSprite(5,selector * 8,7,5,(int *)arrow);
-    lcd.refresh();
-        
-        wait(0.15);
-        
-        if( pad.get_direction() == S ){
-            if( selector < 4 ){
-            selector ++;
-            }
-        }
-        if( pad.get_direction() == N ){
-            if( selector > 1 ){
-            selector --;
-            }
-        }
-    
-    if( selector == 1 ){
-        imposs.set_level_one();
-    }
-    if( selector == 2 ){
-        imposs.set_level_two();
-    }
-    if( selector == 3 ){
-        imposs.set_level_three();
-    }
-    if( selector == 4 ){
-        imposs.set_level_four();
-    }
-       
-  }
-}
\ No newline at end of file