contains my game for the embedded systems project 2645
Dependencies: mbed FXOS8700CQQQ
Diff: GameTests/tests.h
- Revision:
- 33:24ef796ff2c8
- Parent:
- 29:e660274d8222
- Child:
- 39:822b66b1c935
--- a/GameTests/tests.h Mon Apr 29 17:34:37 2019 +0000 +++ b/GameTests/tests.h Fri May 03 00:27:52 2019 +0000 @@ -3,9 +3,9 @@ #include "RocketRacer.h" #include "Menus.h" #include "GameTones.h" - + - /** Menus class + /** tests class @brief C++ class containing the tests for methods @@ -34,17 +34,21 @@ setup(); - test.test_welcomeMenu(pad,lcd); - test.test_Play_Welcome_Melody(pad); - test.test_End_Game_Melody(Gamepad &pad); - test.test_drawMenu(lcd, pad); - test.test_credits_page(lcd,pad); - test.test_loading_menu(lcd); - test.test_InstructionsMenu(pad,lcd); - test.test_Game_Loop(pad,lcd); - test.test_Joystick_position(pad); - test.test_Generate_New_Enemy(); - + while(1){ +// test.test_welcomeMenu(pad,lcd); +// test.test_Play_Welcome_Melody(pad); +// test.test_End_Game_Melody(Gamepad &pad); +// test.test_drawMenu(lcd, pad); +// test.test_credits_page(lcd,pad); +// test.test_loading_menu(lcd); +// test.test_InstructionsMenu(pad,lcd); +// test.test_Game_Loop(pad,lcd); +// test.test_Joystick_position(pad); +// test.test_Generate_New_Enemy(); +// test.test_Joystick_position(pad); +// test_check_button_pressed(pad,lcd); + test.test_accelerometer_position(pad); + } @@ -114,7 +118,7 @@ */ void test_Game_Loop(Gamepad &pad,N5110 &lcd); /** - * @brief method to test the position of the joystick and prints its current state + * @brief method to test the position of the joystick and prints its current state and return true * @param pad @details calls the Gamepad object to be passed to the methods called inside this method */ bool test_Joystick_position(Gamepad &pad); @@ -123,6 +127,17 @@ * @details it tests if the randomly genrated number is 1,2 or 3 and returns true otherwise false */ bool test_Generate_New_Enemy(); + /** + * @brief method to test the position of the accelerometer and prints its current state and return true + * @param pad @details calls the Gamepad object to be passed to the methods called inside this method + */ + bool test_accelerometer_position(Gamepad &pad); + /** + * @brief method to test button presses in the menu and return true, false otherwise + * @param pad @details calls the Gamepad object to be passed to the methods called inside this method + * @param lcd @details calls the lcd object to be passed to the methods called inside this method + */ + bool test_check_button_pressed(Gamepad &pad,N5110 &lcd); private: Menus menu;