Mortal Kombat Game ELEC2645
Dependencies: mbed N5110 ShiftReg Joystick
Diff: main.cpp
- Revision:
- 20:4ca04fd0965a
- Parent:
- 19:6c63e1dd7c85
- Child:
- 21:fad1c9f010d1
--- a/main.cpp Fri Apr 30 03:49:59 2021 +0000 +++ b/main.cpp Fri May 07 16:58:36 2021 +0000 @@ -6,8 +6,6 @@ #include "Menu.h" #include "Enemy.h" #include "GameEngine.h" -///////////// definitions ///////////////// -#define HEALTH 30 ///////////// objects ///////////////////// GameEngine game; Fighter fighter; @@ -20,8 +18,6 @@ AnalogIn joy_v(p20); AnalogIn joy_h(p19); N5110 lcd(p14,p8,p9,p10,p11,p13,p21); -BusOut leds(LED4,LED3,LED2,LED1); -Serial pc(USBTX, USBRX); //////////// functions //////////////////// void init(); void menu_screen(); @@ -31,8 +27,7 @@ int main() { init(); - // int fighter_health = game.get_fighter_health(); - // menu_screen(); + menu_screen(); while(1) { lcd.clear(); draw_background(); @@ -49,27 +44,19 @@ } void menu_screen() { - menu.main_menu(lcd); // printing the menu screen - wait(3.5f); - menu.created_by(lcd); // 2nd menu screen - wait(3.5f); - menu.homescreen(lcd); // print homescreen - menu.menu_selection(lcd, buttonA, buttonB, buttonC, buttonD); // function to ask user to select menu item + menu.menu_render(lcd); } - void draw_background() { // lcd.drawLine(x1, y1, x2, y2, type); lcd.drawLine(0,46,82,46,1); // draws ground platform lcd.drawLine(0,46,0,25,1); // draws first side wall lcd.drawLine(82,46,82,25,1); // draws second side wall lcd.refresh(); - } +} void game_over(int loser) { lcd.clear(); lcd.printString(" Game Over! ",15,2); - } - - +}