Snake vs Block Game to be run upon K64F.

Dependencies:   mbed

Revision:
85:d50ba0994676
Parent:
83:329da564799a
Child:
104:17040265b7b4
diff -r 9950d561fdf8 -r d50ba0994676 MenuClasses/Tutorial/Tutorial.cpp
--- a/MenuClasses/Tutorial/Tutorial.cpp	Mon May 06 16:15:21 2019 +0000
+++ b/MenuClasses/Tutorial/Tutorial.cpp	Mon May 06 23:41:03 2019 +0000
@@ -194,6 +194,86 @@
     {0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0},
 };
 
+
+int BlockPixel[22][51] = {
+    {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
+    {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
+    {1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1},
+    {1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,1},
+    {1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,1,0,0,1,0,1,0,0,1},
+    {1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,0,0,0,1,0,0,0,1},
+    {1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0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0,0,0,1},
+    {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
+    {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
+
+};
+
 int Back[9][19] = {
     {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
     {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
@@ -215,18 +295,30 @@
 
 void Tutorial::Implement()
 {
-    //Only executed if back is not pressed. Takes us to tutorial of how to navigate through the tutorial.
-    if(_backPressed == false) { Tutorial::gamePad(); }
-    //Only executed if back is not pressed. Takes us to tutorial of how to operate settings.
-    if(_backPressed == false) { Tutorial::settings(); }
-    //Only executed if back is not pressed. Takes us to tutorial of how to navigate through main menu.
-    if(_backPressed == false) { Tutorial::controlsToNavigateInMenu(); } 
-    //Only executed if back is not pressed. Takes us to tutorial of how to navigate through mode and speed menu.
-    if(_backPressed == false) { Tutorial::controlsToNavigateGameModeSpeed(); }
-    //Only executed if back is not pressed. Takes us to tutorial of how to use in game controls and how to move snake.
-    if(_backPressed == false) { Tutorial::controlsToPlayGame(); }
-    //Only executed if back is not pressed. Takes us to tutorial of how to navigate back and forth in menus & start or end a game..
-    if(_backPressed == false) { Tutorial::controlsForPreviousOrNext(); }
+    //All these functions are only executed if back is not pressed.
+    //Takes us to tutorial of how to navigate through the tutorial.
+    Tutorial::gamePad();
+    //Takes us to tutorial of how to operate settings.
+    Tutorial::settings();
+    //Takes us to tutorial of how to navigate through main menu.
+    Tutorial::controlsToNavigateInMenu();
+    //Takes us to tutorial of how to navigate through mode and speed menu.
+    Tutorial::controlsToNavigateGameModeSpeed();
+    //Takes us to tutorial of how to use in game controls and how to move snake.
+    Tutorial::controlsToPlayGame();
+    //Takes us to tutorial of how to navigate back and forth in menus & start or end a game.
+    Tutorial::controlsForPreviousOrNext();
+    //Takes us to tutorial of how to react to a block in the way of our game.
+    //This is sub-divided in three as it has three frames.
+    Tutorial::BlockTutorialA();
+    Tutorial::BlockTutorialB();
+    Tutorial::BlockTutorialC();
+    //Takes us to tutorial of how to react to food in the way of our game.
+    Tutorial::FoodTutorial();
+    //Takes us to tutorial of what the barrier does in our game.
+    Tutorial::BarrierTutorial();
+    //Talks us through some general information about the game.
+    Tutorial::GeneralInfo();
     //RESETS _backPressed, for displaying all the tutorials if it has been selected once again in main menu.
     _backPressed = false;
 }
@@ -245,122 +337,310 @@
 
 void Tutorial::gamePad()
 {
-    _lcd->clear();
-    while ((_pad->check_event(Gamepad::START_PRESSED) == false)&&(_pad->check_event(Gamepad::A_PRESSED) == false)) {  //if button pressed.
-        _lcd->drawSprite(20,0,27,44,(int *)g_pad); //Function used to draw the sprite.
-        _lcd->drawSprite(0,0,9,19,(int *)Back); //Function used to draw the back sprite.
-        _lcd->printString("Press Start or",0,4);
-        _lcd->printString("A to proceed",7,5);
-        _lcd->refresh();
+    if(_backPressed == false) {
+        _lcd->clear();
+        while ((_pad->check_event(Gamepad::START_PRESSED) == false)&&(_pad->check_event(Gamepad::A_PRESSED) == false)) {  //if button pressed.
+            _lcd->drawSprite(20,0,27,44,(int *)g_pad); //Function used to draw the sprite.
+            _lcd->drawSprite(0,0,9,19,(int *)Back); //Function used to draw the back sprite.
+            _lcd->printString("Press Start or",0,4);
+            _lcd->printString("A to proceed",7,5);
+            _lcd->refresh();
 
-        if (Tutorial::checkBackPressed()) { return; }    //if back is pressed, the function is terminated.
+            if (Tutorial::checkBackPressed()) {
+                return;    //if back is pressed, the function is terminated.
+            }
+        }
+        wait(0.3);
+        _pad->tone(1000.0,0.1);
     }
-    wait(0.25);
-    _pad->tone(1000.0,0.1);
 }
 
 void Tutorial::settings()
 {
-    _lcd->clear();
-    while ((_pad->check_event(Gamepad::START_PRESSED) == false)&&(_pad->check_event(Gamepad::A_PRESSED) == false)) {  //if button pressed.
-        _lcd->drawSprite(20,0,27,44,(int *)Pot); //Function used to draw the sprite.
-        _lcd->drawSprite(0,0,9,19,(int *)Back); //Function used to draw the back sprite.
-        _lcd->printString("Rotate pot",12,4);
-        _lcd->printString("in settings",9,5);
-        _lcd->refresh();
+    if(_backPressed == false) {
+        _lcd->clear();
+        while ((_pad->check_event(Gamepad::START_PRESSED) == false)&&(_pad->check_event(Gamepad::A_PRESSED) == false)) {  //if button pressed.
+            _lcd->drawSprite(20,0,27,44,(int *)Pot); //Function used to draw the sprite.
+            _lcd->drawSprite(0,0,9,19,(int *)Back); //Function used to draw the back sprite.
+            _lcd->printString("Rotate pot",12,4);
+            _lcd->printString("in settings",9,5);
+            _lcd->refresh();
 
-        if (Tutorial::checkBackPressed()) { return; }    //if back is pressed, the function is terminated.
+            if (Tutorial::checkBackPressed()) {
+                return;    //if back is pressed, the function is terminated.
+            }
+        }
+        wait(0.3);
+        _pad->tone(1000.0,0.1);
     }
-    wait(0.25);
-    _pad->tone(1000.0,0.1);
 }
 
 void Tutorial::controlsToNavigateInMenu()
 {
-    _lcd->clear();
-    while ((_pad->check_event(Gamepad::START_PRESSED) == false)&&(_pad->check_event(Gamepad::A_PRESSED) == false)) {  //if button pressed.
-        _lcd->drawSprite(20,0,27,44,(int *)UpDown); //Function used to draw the sprite.
-        _lcd->drawSprite(0,0,9,19,(int *)Back); //Function used to draw the back sprite.
-        _lcd->printString("Up/Down",21,4);
-        _lcd->printString("for Main Menu",3,5);
-        _lcd->refresh();
+    if(_backPressed == false) {
+        _lcd->clear();
+        while ((_pad->check_event(Gamepad::START_PRESSED) == false)&&(_pad->check_event(Gamepad::A_PRESSED) == false)) {  //if button pressed.
+            _lcd->drawSprite(20,0,27,44,(int *)UpDown); //Function used to draw the sprite.
+            _lcd->drawSprite(0,0,9,19,(int *)Back); //Function used to draw the back sprite.
+            _lcd->printString("Up/Down",21,4);
+            _lcd->printString("for Main Menu",3,5);
+            _lcd->refresh();
 
-        if (Tutorial::checkBackPressed()) { return; }    //if back is pressed, the function is terminated.
+            if (Tutorial::checkBackPressed()) {
+                return;    //if back is pressed, the function is terminated.
+            }
+        }
+        wait(0.3);
+        _pad->tone(1000.0,0.1);
     }
-    wait(0.25);
-    _pad->tone(1000.0,0.1);
 }
 
 void Tutorial::controlsToNavigateGameModeSpeed()
 {
-    _lcd->clear();
-    while ((_pad->check_event(Gamepad::START_PRESSED) == false)&&(_pad->check_event(Gamepad::A_PRESSED) == false)) {  //if button pressed.
-        _lcd->drawSprite(20,0,27,44,(int *)LeftRight); //Function used to draw the sprite.
-        _lcd->drawSprite(0,0,9,19,(int *)Back); //Function used to draw the back sprite.
-        _lcd->printString("Left/Right for",0,4);
-        _lcd->printString("Mode & Speed",7,5);
-        _lcd->refresh();
+    if(_backPressed == false) {
+        _lcd->clear();
+        while ((_pad->check_event(Gamepad::START_PRESSED) == false)&&(_pad->check_event(Gamepad::A_PRESSED) == false)) {  //if button pressed.
+            _lcd->drawSprite(20,0,27,44,(int *)LeftRight); //Function used to draw the sprite.
+            _lcd->drawSprite(0,0,9,19,(int *)Back); //Function used to draw the back sprite.
+            _lcd->printString("Left/Right for",0,4);
+            _lcd->printString("Mode & Speed",7,5);
+            _lcd->refresh();
 
-        if (Tutorial::checkBackPressed()) { return; }    //if back is pressed, the function is terminated.
+            if (Tutorial::checkBackPressed()) {
+                return;    //if back is pressed, the function is terminated.
+            }
+        }
+        wait(0.3);
+        _pad->tone(1000.0,0.1);
     }
-    wait(0.3);
-    _pad->tone(1000.0,0.1);
 }
 
 void Tutorial::controlsToPlayGame()
 {
-    _lcd->clear();
-    while ((_pad->check_event(Gamepad::START_PRESSED) == false)&&(_pad->check_event(Gamepad::A_PRESSED) == false)) {  //if button pressed.
-        _lcd->drawSprite(20,0,31,44,(int *)GameControls); //Function used to draw the sprite.
-        _lcd->drawSprite(0,0,9,19,(int *)Back); //Function used to draw the back sprite.
-        _lcd->printString("InGameControls",0,4);
-        _lcd->printString("to move snake",4,5);
-        _lcd->refresh();
+    if(_backPressed == false) {
+        _lcd->clear();
+        while ((_pad->check_event(Gamepad::START_PRESSED) == false)&&(_pad->check_event(Gamepad::A_PRESSED) == false)) {  //if button pressed.
+            _lcd->drawSprite(20,0,31,44,(int *)GameControls); //Function used to draw the sprite.
+            _lcd->drawSprite(0,0,9,19,(int *)Back); //Function used to draw the back sprite.
+            _lcd->printString("InGameControls",0,4);
+            _lcd->printString("to move snake",4,5);
+            _lcd->refresh();
 
-        if (Tutorial::checkBackPressed()) { return; }    //if back is pressed, the function is terminated.
-    }
-    wait(0.25);
-    _pad->tone(1000.0,0.1);
+            if (Tutorial::checkBackPressed()) {
+                return;    //if back is pressed, the function is terminated.
+            }
+        }
+        wait(0.3);
+        _pad->tone(1000.0,0.1);
 
-    _lcd->clear();
-    while ((_pad->check_event(Gamepad::START_PRESSED) == false)&&(_pad->check_event(Gamepad::A_PRESSED) == false)) {  //if button pressed.
-        _lcd->drawSprite(20,0,31,44,(int *)GameControls); //Function used to draw the sprite.
-        _lcd->drawSprite(0,0,9,19,(int *)Back); //Function used to draw the back sprite.
-        _lcd->printString("Depends on",12,4);
-        _lcd->printString("mode selection",0,5);
-        _lcd->refresh();
+        _lcd->clear();
+        while ((_pad->check_event(Gamepad::START_PRESSED) == false)&&(_pad->check_event(Gamepad::A_PRESSED) == false)) {  //if button pressed.
+            _lcd->drawSprite(20,0,31,44,(int *)GameControls); //Function used to draw the sprite.
+            _lcd->drawSprite(0,0,9,19,(int *)Back); //Function used to draw the back sprite.
+            _lcd->printString("Depends on",12,4);
+            _lcd->printString("mode selection",0,5);
+            _lcd->refresh();
 
-        if (Tutorial::checkBackPressed()) { return; }    //if back is pressed, the function is terminated.
+            if (Tutorial::checkBackPressed()) {
+                return;    //if back is pressed, the function is terminated.
+            }
+        }
+        wait(0.3);
+        _pad->tone(1000.0,0.1);
     }
-    wait(0.25);
-    _pad->tone(1000.0,0.1);
 }
 
 void Tutorial::controlsForPreviousOrNext()
 {
-    _lcd->clear();
-    while ((_pad->check_event(Gamepad::START_PRESSED) == false)&&(_pad->check_event(Gamepad::A_PRESSED) == false)) {  //if button pressed.
-        _lcd->drawSprite(20,0,27,44,(int *)NextBack); //Function used to draw the sprite.
-        _lcd->drawSprite(0,0,9,19,(int *)Back); //Function used to draw the back sprite.
-        _lcd->printString("Previous/Next",4,4);
-        _lcd->printString("End/Start",16,5);
-        _lcd->refresh();
+    if(_backPressed == false) {
+        _lcd->clear();
+        while ((_pad->check_event(Gamepad::START_PRESSED) == false)&&(_pad->check_event(Gamepad::A_PRESSED) == false)) {  //if button pressed.
+            _lcd->drawSprite(20,0,27,44,(int *)NextBack); //Function used to draw the sprite.
+            _lcd->drawSprite(0,0,9,19,(int *)Back); //Function used to draw the back sprite.
+            _lcd->printString("Previous/Next",4,4);
+            _lcd->printString("End/Start",16,5);
+            _lcd->refresh();
+
+            if (Tutorial::checkBackPressed()) {
+                return;    //if back is pressed, the function is terminated.
+            }
+        }
+        wait(0.3);
+        _pad->tone(1000.0,0.1);
+
+        _lcd->clear();
+        while ((_pad->check_event(Gamepad::START_PRESSED) == false)&&(_pad->check_event(Gamepad::A_PRESSED) == false)) {  //if button pressed.
+            _lcd->drawSprite(20,0,27,44,(int *)NextBack); //Function used to draw the sprite.
+            _lcd->drawSprite(0,0,9,19,(int *)Back); //Function used to draw the back sprite.
+            _lcd->printString("Works in both",5,4);
+            _lcd->printString("menu and game",5,5);
+            _lcd->refresh();
+
+            if (Tutorial::checkBackPressed()) {
+                return;    //if back is pressed, the function is terminated.
+            }
+        }
+        wait(0.3);
+        _pad->tone(1000.0,0.1);
+    }
+}
+
+void Tutorial::BlockTutorialA()
+{
+    if(_backPressed == false) {
+        _lcd->clear();
+        while ((_pad->check_event(Gamepad::START_PRESSED) == false)&&(_pad->check_event(Gamepad::A_PRESSED) == false)) {  //if button pressed.
+            _lcd->drawSprite(24,0,22,51,(int *)BlockPixel); //Function used to draw the sprite.
+            _lcd->drawSprite(0,0,9,19,(int *)Back); //Function used to draw the back sprite.
+            _lcd->printString("Trust me!, You",0,3);
+            _lcd->printString("want to avoid",3,4);
+            _lcd->printString("these blocks!",3,5);
+            _lcd->refresh();
 
-        if (Tutorial::checkBackPressed()) { return; }    //if back is pressed, the function is terminated.
+            if (Tutorial::checkBackPressed()) {
+                return;    //if back is pressed, the function is terminated.
+            }
+        }
+        wait(0.3);
+        _pad->tone(1000.0,0.1);
     }
-    wait(0.3);
-    _pad->tone(1000.0,0.1);
+}
+
+void Tutorial::BlockTutorialB()
+{
+    if(_backPressed == false) {
+        _lcd->clear();
+        while ((_pad->check_event(Gamepad::START_PRESSED) == false)&&(_pad->check_event(Gamepad::A_PRESSED) == false)) {  //if button pressed.
+            _lcd->drawSprite(24,0,22,51,(int *)BlockPixel); //Function used to draw the sprite.
+            _lcd->drawSprite(0,0,9,19,(int *)Back); //Function used to draw the back sprite.
+            _lcd->printString("Number on the",3,3);
+            _lcd->printString("block = total",3,4);
+            _lcd->printString("length reduced",0,5);
+            _lcd->refresh();
+
+            if (Tutorial::checkBackPressed()) {
+                return;    //if back is pressed, the function is terminated.
+            }
+        }
+        wait(0.3);
+        _pad->tone(1000.0,0.1);
+    }
+}
+
+void Tutorial::BlockTutorialC()
+{
+    if(_backPressed == false) {
+        _lcd->clear();
+        while ((_pad->check_event(Gamepad::START_PRESSED) == false)&&(_pad->check_event(Gamepad::A_PRESSED) == false)) {  //if button pressed.
+            _lcd->drawSprite(24,0,22,51,(int *)BlockPixel); //Function used to draw the sprite.
+            _lcd->drawSprite(0,0,9,19,(int *)Back); //Function used to draw the back sprite.
+            _lcd->printString(";)You always",5,3);
+            _lcd->printString("have a chance",2,4);
+            _lcd->printString("to slide away",2,5);
+            _lcd->refresh();
+
+            if (Tutorial::checkBackPressed()) {
+                return;    //if back is pressed, the function is terminated.
+            }
+        }
+        wait(0.3);
+        _pad->tone(1000.0,0.1);
+    }
+}
 
-    _lcd->clear();
-    while ((_pad->check_event(Gamepad::START_PRESSED) == false)&&(_pad->check_event(Gamepad::A_PRESSED) == false)) {  //if button pressed.
-        _lcd->drawSprite(20,0,27,44,(int *)NextBack); //Function used to draw the sprite.
-        _lcd->drawSprite(0,0,9,19,(int *)Back); //Function used to draw the back sprite.
-        _lcd->printString("Works in both",5,4);
-        _lcd->printString("menu and game",5,5);
-        _lcd->refresh();
+void Tutorial::FoodTutorial()
+{
+    if(_backPressed == false) {
+        _lcd->clear();
+        while ((_pad->check_event(Gamepad::START_PRESSED) == false)&&(_pad->check_event(Gamepad::A_PRESSED) == false)) {  //if button pressed.
+            _lcd->drawSprite(24,0,22,51,(int *)FoodPixel); //Function used to draw the sprite.
+            _lcd->drawSprite(0,0,9,19,(int *)Back); //Function used to draw the back sprite.
+            _lcd->printString("Eat all of",10,3);
+            _lcd->printString("these if",17,4);
+            _lcd->printString("possible!!",15,5);
+            _lcd->refresh();
+
+            if (Tutorial::checkBackPressed()) {
+                return;    //if back is pressed, the function is terminated.
+            }
+        }
+        wait(0.3);
+        _pad->tone(1000.0,0.1);
+
+        _lcd->clear();
+        while ((_pad->check_event(Gamepad::START_PRESSED) == false)&&(_pad->check_event(Gamepad::A_PRESSED) == false)) {  //if button pressed.
+            _lcd->drawSprite(24,0,22,51,(int *)FoodPixel); //Function used to draw the sprite.
+            _lcd->drawSprite(0,0,9,19,(int *)Back); //Function used to draw the back sprite.
+            _lcd->printString("They will",14,3);
+            _lcd->printString("increase the",4,4);
+            _lcd->printString("snake's length",0,5);
+            _lcd->refresh();
+
+            if (Tutorial::checkBackPressed()) {
+                return;    //if back is pressed, the function is terminated.
+            }
+        }
+        wait(0.3);
+        _pad->tone(1000.0,0.1);
+    }
+}
 
-        if (Tutorial::checkBackPressed()) { return; }    //if back is pressed, the function is terminated.
+void Tutorial::BarrierTutorial()
+{
+    if(_backPressed == false) {
+        _lcd->clear();
+        while ((_pad->check_event(Gamepad::START_PRESSED) == false)&&(_pad->check_event(Gamepad::A_PRESSED) == false)) {  //if button pressed.
+            _lcd->drawSprite(24,0,22,51,(int *)BarrierPixel); //Function used to draw the sprite.
+            _lcd->drawSprite(0,0,9,19,(int *)Back); //Function used to draw the back sprite.
+            _lcd->printString(":(You cannot):",1,3);
+            _lcd->printString("pass through",7,4);
+            _lcd->printString("these barriers",0,5);
+            _lcd->refresh();
+
+            if (Tutorial::checkBackPressed()) {
+                return;    //if back is pressed, the function is terminated.
+            }
+        }
+        wait(0.3);
+        _pad->tone(1000.0,0.1);
     }
-    wait(0.3);
-    _pad->tone(1000.0,0.1);
+}
+
+void Tutorial::GeneralInfo()
+{
+    if(_backPressed == false) {
+        _lcd->clear();
+        while ((_pad->check_event(Gamepad::START_PRESSED) == false)&&(_pad->check_event(Gamepad::A_PRESSED) == false)) {  //if button pressed.
+            _lcd->drawSprite(0,0,8,19,(int *)Back); //Function used to draw the back sprite.
+            _lcd->printString("IncreaseLength",0,1);
+            _lcd->printString("to a specific",0,2);
+            _lcd->printString("value to go",5,3);
+            _lcd->printString("through each",3,4);
+            _lcd->printString("level, and...",2,5);
+            _lcd->refresh();
+
+            if (Tutorial::checkBackPressed()) {
+                return;    //if back is pressed, the function is terminated.
+            }
+        }
+        wait(0.3);
+        _pad->tone(1000.0,0.1);
+        
+        _lcd->clear();
+        while ((_pad->check_event(Gamepad::START_PRESSED) == false)&&(_pad->check_event(Gamepad::A_PRESSED) == false)) {  //if button pressed.
+            _lcd->drawSprite(0,0,8,19,(int *)Back); //Function used to draw the back sprite.
+            _lcd->printString("here's a TIP:",3,1);
+            _lcd->printString("speed up by",8,2);
+            _lcd->printString("curving across",0,3);
+            _lcd->printString("edges;)",21,4);
+            _lcd->printString("!!!!ENJOY!!!!",3,5);
+            _lcd->refresh();
+
+            if (Tutorial::checkBackPressed()) {
+                return;    //if back is pressed, the function is terminated.
+            }
+        }
+        wait(0.3);
+        _pad->tone(1000.0,0.1);
+    }
 }
\ No newline at end of file