Ben Evans University Second Year Project. Game Called Defender.
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.
Diff: GameEngine/PlayEngine_test.h
- Revision:
- 85:87bc28b151d8
- Parent:
- 83:35d1e846eab2
- Child:
- 87:832ca78426b5
--- a/GameEngine/PlayEngine_test.h Tue May 26 14:39:45 2020 +0000 +++ b/GameEngine/PlayEngine_test.h Tue May 26 19:38:48 2020 +0000 @@ -2,7 +2,7 @@ #define PLAYENGINE_TEST_H /** PlayEngine Test - * @brief Checks that the engine functions of the playble part of game work + * @brief Checks that the engine functions of the playable part of game work * @author Benjamin Evans, University of Leeds * @date May 2020 * @return true if test are passed @@ -10,14 +10,14 @@ bool read_accelerometer_direction_test(Direction expected_d, float roll, float pitch) { - // Objects reqired for test + // Objects required for test PlayEngine engine;; printf("read_accelerometer_direction = %d : ", expected_d); engine.read_accelerometer_direction(roll, pitch); - // Checks if pixel is drawn and therefor testing it hasnt gone of screen + // Checks if pixel is drawn and therefor testing it hasn’t gone of screen if (expected_d == engine.d_) { printf ( "Passed!\n"); return true; @@ -29,18 +29,18 @@ } bool spawn_aliens_test(int expected_alien_num) { - // Objects reqired for test + // Objects required for test PlayEngine engine; engine.alien_number_ = expected_alien_num; printf("spawn_aliens : "); //spawn number of expected aliens - for(int i = 1; i <= expected_alien_num; i++) { + for (int i = 1; i <= expected_alien_num; i++) { engine.spawn_aliens(); } - // Checks if pixel is drawn and therefor testing it hasnt gone of screen + // Checks if pixel is drawn and therefor testing it hasn’t gone of screen if (engine.alien_vector.size() == expected_alien_num) { printf ( "Passed!\n"); return true; @@ -52,18 +52,18 @@ } bool create_alien_test(int expected_alien_num) { - // Objects reqired for test + // Objects required for test PlayEngine engine; engine.alien_number_ = expected_alien_num; printf("create_aliens : "); //spawn number of expected aliens - for(int i = 1; i <= expected_alien_num; i++) { + for (int i = 1; i <= expected_alien_num; i++) { engine.create_alien(); } - // Checks if pixel is drawn and therefor testing it hasnt gone of screen + // Checks if pixel is drawn and therefor testing it hasn’t gone of screen if (engine.alien_vector.size() == expected_alien_num) { printf ( "Passed!\n"); return true; @@ -75,7 +75,7 @@ } bool create_explosion_test(int expected_explosion_num) { - // Objects reqired for test + // Objects required for test PlayEngine engine; Vector2D pos = {5,4}; @@ -83,11 +83,11 @@ printf("Create_explosion : "); //spawn number of expected aliens - for(int i = 1; i <= expected_explosion_num; i++) { + for (int i = 1; i <= expected_explosion_num; i++) { engine.create_explosion(pos); } - // Checks if pixel is drawn and therefor testing it hasnt gone of screen + // Checks if pixel is drawn and therefor testing it hasn’t gone of screen if (engine.explosion_vector.size() == expected_explosion_num) { printf ( "Passed!\n"); return true; @@ -100,7 +100,7 @@ bool draw_explosions_test(int expected_pixel_status, int expected_postion_x, int expected_postion_y) { - // Objects reqired for test + // Objects required for test PlayEngine engine; Gamepad pad; N5110 lcd; @@ -117,7 +117,7 @@ int actual_pixel_status = lcd.getPixel(expected_postion_x+3, expected_postion_y+3); - // Checks if pixel is drawn and therefor testing it hasnt gone of screen + // Checks if pixel is drawn and therefor testing it hasn’t gone of screen if (actual_pixel_status == expected_pixel_status) { printf ( "Passed!\n"); return true; @@ -129,17 +129,17 @@ } bool spawn_people_test(int expected_people_num) { - // Objects reqired for test + // Objects required for test PlayEngine engine; printf("spawn_people : "); //spawn number of expected aliens - for(int i = 1; i <= expected_people_num; i++) { + for (int i = 1; i <= expected_people_num; i++) { engine.spawn_people(); } - // Checks if pixel is drawn and therefor testing it hasnt gone of screen + // Checks if pixel is drawn and therefor testing it hasn’t gone of screen if (engine.people_vector.size() == expected_people_num) { printf ( "Passed!\n"); return true; @@ -151,16 +151,16 @@ } bool create_people_test(int expected_people_num) { - // Objects reqired for test + // Objects required for test PlayEngine engine; printf("create_people : "); //spawn number of expected aliens - for(int i = 1; i <= expected_people_num; i++) { + for (int i = 1; i <= expected_people_num; i++) { engine.create_people(); } - // Checks if pixel is drawn and therefor testing it hasnt gone of screen + // Checks if pixel is drawn and therefor testing it hasn’t gone of screen if (engine.people_vector.size() == expected_people_num) { printf ( "Passed!\n"); return true; @@ -172,18 +172,18 @@ } bool reset_map_timer_test(Direction expected_d, bool spaceship_destroyed) { - // Objects reqired for test + // Objects required for test PlayEngine engine; printf("reset_map_timer %d: ",spaceship_destroyed); - // Pre defines varibales + // Pre defines variables engine.spaceship_destroyed_ = spaceship_destroyed; engine.d_ = N; engine.reset_map_timer(); - // Checks if pixel is drawn and therefor testing it hasnt gone of screen + // Checks if pixel is drawn and therefor testing it hasn’t gone of screen if (engine.d_ == expected_d) { printf ( "Passed!\n"); return true; @@ -194,18 +194,18 @@ } bool reset_map_test() { - // Objects reqired for test + // Objects required for test PlayEngine engine; printf("reset_map_ : "); - // Creat object for map functions + // Create object for map functions engine.spawn_people(); engine.spawn_aliens(); engine.reset_map(); - // Checks if pixel is drawn and therefor testing it hasnt gone of screen + // Checks if pixel is drawn and therefor testing it hasn’t gone of screen if (engine.people_vector.size()== 0 && engine.alien_vector.size() == 0) { printf ( "Passed!\n"); return true; @@ -215,4 +215,4 @@ return false; } } -#endif \ No newline at end of file +#endif