Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 /* 00002 ELEC2645 Embedded Systems Project 00003 School of Electronic & Electrical Engineering 00004 University of Leeds 00005 Name: Benjamin Evans 00006 Username:el18bpe 00007 Student ID Number:201216635 00008 Date:23/02/2020 00009 */ 00010 00011 // pre-processor directives ---------------------------------------------------- 00012 #include "GameEngine.h" 00013 00014 #ifdef GAME_TEST 00015 #include "test.h" 00016 #endif 00017 00018 // Objects --------------------------------------------------------------------- 00019 00020 /** Define Game Engine object*/ 00021 GameEngine engine; 00022 00023 // Functions ------------------------------------------------------------------- 00024 00025 /** Runs the different test for the game */ 00026 void test_game(); 00027 00028 int main() 00029 { 00030 // Initialise the game engine 00031 engine.init(); 00032 00033 // Tests game 00034 test_game(); 00035 00036 while (1) { 00037 // Selects the different parts of the game 00038 engine.game_select_part(); 00039 00040 // Sets frame rate to 20 FPS for menu system 00041 wait(0.05); 00042 } 00043 } 00044 00045 void test_game(){ 00046 // Compile with tests 00047 #ifdef GAME_TEST 00048 00049 // Spaceship tests 00050 run_spaceship_movement_tests(); 00051 run_spaceship_draw_tests(); 00052 00053 // Map tests 00054 run_map_draw_tests(); 00055 00056 // Alien tests 00057 run_alien_draw_tests(); 00058 run_check_collision_test(); 00059 00060 // Weapons tests 00061 run_weapons_draw_tests(); 00062 00063 // Explosion tests 00064 run_explosion_draw_tests(); 00065 00066 // People tests 00067 run_people_draw_tests(); 00068 00069 // Menu tests 00070 run_menu_select_part_test(); 00071 run_menu_scroll_test(); 00072 run_menu_draw_part_test(); 00073 00074 // HUD tests 00075 run_HUD_draw_test(); 00076 00077 // Saved Games tests 00078 run_saved_games_scroll_test(); 00079 run_display_saved_games_test(); 00080 run_save_game_screen_test(); 00081 00082 // Settings tests 00083 run_settings_select_part_test(); 00084 run_settings_scroll_test(); 00085 run_display_settings_screen_test(); 00086 00087 // Play Engine tests 00088 run_no_high_scores_test(); 00089 00090 // Play Engine tests 00091 run_read_accelerometer_direction_test(); 00092 run_spawn_aliens_test(); 00093 run_create_alien_test(); 00094 run_create_explosion_test(); 00095 run_spawn_people_test(); 00096 run_reset_map_timer_test(); 00097 run_reset_map_test(); 00098 00099 #endif 00100 }
Generated on Fri Aug 5 2022 06:55:07 by
1.7.2