Ben Evans University Second Year Project. Game Called Defender.

Dependencies:   mbed

https://os.mbed.com/media/uploads/evanso/84bc1a30759fd6a1e3f1fd1fae3e97c2.png

Hello, soldier, you have been specially selected as the defender of planet earth.

Your mission, if you choose to accept it. Fly around the planet and pulverise invading alien ships for as long as you can. Stop the aliens abducting the innocent people on the ground. Be warned if an alien ship manages to abduct a person and take them to top of the screen, they will no longer move randomly and will begin to hunt you down. This sounds like a challenge you were trained for.

But don’t worry soldier you’re not going into battle empty-handed. Your ship is equipped with a state of the art laser beam that has unlimited ammo and four smart bombs that will destroy anything on the screen. The ship also has three lives so use them wisely.

As time goes on more alien ships will arrive on planet earth increasing the difficulty of your mission. And remember the landscape bellow loops around so if you continually fly in the same direction you go to your original position. Good luck soldier.

Revision:
67:a2984682d641
Parent:
66:33f479036a5d
Child:
70:8c4572d17441
--- a/test.h	Thu May 21 17:37:15 2020 +0000
+++ b/test.h	Thu May 21 20:23:24 2020 +0000
@@ -9,6 +9,7 @@
 #include "People_test.h"
 #include "Menu_test.h"
 #include "HUD_test.h"
+#include "SavedGames_test.h"
  
 /** Test
  * @brief Runs all tests for game 
@@ -245,4 +246,57 @@
     passed_counter);
 }
 
+// Saved Games tests -----------------------------------------------------------
+
+void run_saved_games_scroll_test(){
+    printf ("\nsaved_games_scroll_test() \n\n");
+    int passed_counter = 0;
+
+    // Runs test with all differnt possible inputs
+    if (saved_games_scroll_test(CENTRE, 1)) passed_counter++;
+    if (saved_games_scroll_test(N, 2)) passed_counter++;
+    if (saved_games_scroll_test(NE, 2)) passed_counter++;
+    if (saved_games_scroll_test(E,  1)) passed_counter++;
+    if (saved_games_scroll_test(SE, 3)) passed_counter++;
+    if (saved_games_scroll_test(S, 3)) passed_counter++;
+    if (saved_games_scroll_test(SW, 3)) passed_counter++;
+    if (saved_games_scroll_test(W,  1)) passed_counter++;
+    if (saved_games_scroll_test(NW, 2)) passed_counter++;
+    
+    // prints results
+    printf ("\nsaved_games_scroll_test passed %d tests out of 9\n\n\n",
+    passed_counter);
+}
+
+void run_display_saved_games_test(){
+    printf ("\nTesting display_saved_games_test() \n\n");
+    int passed_counter = 0;
+
+    // Runs test with all differnt possible inputs
+    if (display_saved_games_test(1, 41, 18 )) passed_counter++;
+    if (display_saved_games_test(1, 41, 34)) passed_counter++;
+    if (display_saved_games_test(1, 9, 1)) passed_counter++;
+    if (display_saved_games_test(0, 0, 0)) passed_counter++;
+       
+    // prints results
+    printf ("\ndisplay_saved_games_test %d tests out of 4\n\n\n",
+    passed_counter);
+}
+
+void run_save_game_screen_test(){
+    printf ("\nTesting save_game_screen_test() \n\n");
+    int passed_counter = 0;
+
+    // Runs test with all differnt possible inputs
+    if (save_game_screen_test(1, 41, 18 )) passed_counter++;
+    if (save_game_screen_test(1, 41, 34)) passed_counter++;
+    if (save_game_screen_test(1, 3, 1)) passed_counter++;
+    if (save_game_screen_test(0, 0, 0)) passed_counter++;
+       
+    // prints results
+    printf ("\ndsave_game_screen_test %d tests out of 4\n\n\n",
+    passed_counter);
+}
+
+
 #endif
\ No newline at end of file