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:
70:8c4572d17441
Parent:
67:a2984682d641
Child:
79:66bcf8fa2d2d
--- a/test.h	Fri May 22 13:02:26 2020 +0000
+++ b/test.h	Fri May 22 17:20:22 2020 +0000
@@ -10,6 +10,7 @@
 #include "Menu_test.h"
 #include "HUD_test.h"
 #include "SavedGames_test.h"
+#include "Settings_test.h"
  
 /** Test
  * @brief Runs all tests for game 
@@ -224,6 +225,22 @@
     passed_counter);
 }
 
+void run_menu_draw_part_test(){
+    printf ("\nmenu_draw_part_test() \n\n");
+    int passed_counter = 0;
+
+    // Runs test with all differnt possible inputs
+    if (menu_draw_part_test(1, 42, 27)) passed_counter++;
+    if (menu_draw_part_test(1, 41, 43)) passed_counter++;
+    if (menu_draw_part_test(0, 9, 1)) passed_counter++;
+    if (menu_draw_part_test(0, 0, 0)) passed_counter++;
+       
+    // prints results
+    printf ("\nmenu_draw_part_test %d tests out of 4\n\n\n",
+    passed_counter);
+}
+
+
 
 
 // HUD tests -------------------------------------------------------------------
@@ -246,6 +263,9 @@
     passed_counter);
 }
 
+
+
+
 // Saved Games tests -----------------------------------------------------------
 
 void run_saved_games_scroll_test(){
@@ -294,9 +314,60 @@
     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",
+    printf ("\nsave_game_screen_test %d tests out of 4\n\n\n",
     passed_counter);
 }
 
 
+
+// Settings tests --------------------------------------------------------------
+
+void run_settings_select_part_test(){
+    printf ("\nTesting settings_select_part_test() \n\n");
+    int passed_counter = 0;
+
+    // Runs test with all differnt possible inputs
+    if (settings_select_part_test(acc,1)) passed_counter++;
+    if (settings_select_part_test(joy,0)) passed_counter++;
+    
+    // prints results
+    printf ("\nsettings_select_part_test passed %d tests out of 2\n\n\n",
+    passed_counter);
+}
+
+void run_settings_scroll_test(){
+    printf ("\nsettings_scroll_test() \n\n");
+    int passed_counter = 0;
+
+    // Runs test with all differnt possible inputs
+    if (settings_scroll_test(CENTRE, controls)) passed_counter++;
+    if (settings_scroll_test(N, sound_fx)) passed_counter++;
+    if (settings_scroll_test(NE, sound_fx)) passed_counter++;
+    if (settings_scroll_test(E, controls)) passed_counter++;
+    if (settings_scroll_test(SE, contrast)) passed_counter++;
+    if (settings_scroll_test(S, contrast)) passed_counter++;
+    if (settings_scroll_test(SW, contrast)) passed_counter++;
+    if (settings_scroll_test(W,  controls)) passed_counter++;
+    if (settings_scroll_test(NW, sound_fx)) passed_counter++;
+    
+    // prints results
+    printf ("\nsettings_scroll_test passed %d tests out of 9\n\n\n",
+    passed_counter);
+}
+
+void run_display_settings_screen_test(){
+    printf ("\ndisplay_settings_screen_test_test() \n\n");
+    int passed_counter = 0;
+
+    // Runs test with all differnt possible inputs
+    if (display_settings_screen_test(1, 41, 18 )) passed_counter++;
+    if (display_settings_screen_test(1, 41, 34)) passed_counter++;
+    if (display_settings_screen_test(0, 9, 1)) passed_counter++;
+    if (display_settings_screen_test(0, 0, 0)) passed_counter++;
+       
+    // prints results
+    printf ("\ndisplay_settings_screen_test %d tests out of 4\n\n\n",
+    passed_counter);
+}
+
 #endif
\ No newline at end of file