This is the Mexican Standoff prototype made by Francisco Martin and Andrew Smith. Please refer to the following link for instructions on hardware hookup: https://developer.mbed.org/users/fomartin/notebook/mexican-standoff-reaction-game/

Dependencies:   SDFileSystem mbed-rtos mbed wave_player 4DGL-uLCD-SE PinDetect

States/GameOver.cpp

Committer:
fomartin
Date:
2016-03-14
Revision:
2:3c1a5079243d
Parent:
1:4976bbb3376f

File content as of revision 2:3c1a5079243d:

#include "States.h"

GameOver::GameOver(uLCD_4DGL &uLCD, PinDetect &Button0, PinDetect &Button1, 
                                    PinDetect &Button2, PinDetect &Button3, 
                                    int winningPlayer)
{     
    
    uLCD.background_color(BLACK);

 
    uLCD.cls();
    uLCD.textbackground_color(BLACK);
    uLCD.color(WHITE);
    uLCD.printf("\n     Game Over       \n");    

    //display the game over screen with the winning player
    if(winningPlayer == 1)
    {
        uLCD.locate(0, 5);
        uLCD.printf("\n");
        uLCD.printf("  PLAYER 1 WINS!!  \n");
        uLCD.printf("\n");
        uLCD.printf(" PLAYER 2 SUCKS... \n");
    }
    else
    {      
        uLCD.printf("\n");
        uLCD.printf("  PLAYER 2 WINS!!  \n");
        uLCD.printf("\n");
        uLCD.printf(" PLAYER 1 SUCKS... \n");
    }  
    
    //return after any button press
    while(Button0 && Button1 && Button2 && Button3) {}   
}