Version of Robotron arcade game using LPC1768, a Gameduino shield, a serial EEPROM (for high scores), two microswitch joysticks and two buttons plus a box to put it in. 20 levels of mayhem.

Dependencies:   25LCxxx_SPI CommonTypes Gameduino mbed

HighScoreEntry.h

Committer:
RichardE
Date:
2013-06-11
Revision:
14:46a353b2a8e8
Parent:
4:673eb9735d44
Child:
15:d8ea0c7b7e64

File content as of revision 14:46a353b2a8e8:

/*
 * SOURCE FILE : HighScoreEntry.h
 *
 * Definition of class HighScoreEntry.
 * Routine to allow player to enter their name using joysticks.
 *
 */

#ifndef HighScoreEntryDefined

  #define HighScoreEntryDefined

  #include "Types.h"
  #include "PanelControls.h"   // for reading panel controls.
  #include "PlayerName.h"
  #include "Gameduino.h"
  
  class HighScoreEntry {

  public :

    /***************/
    /* CONSTRUCTOR */
    /***************/
    HighScoreEntry();

    /**************/
    /* DESTRUCTOR */
    /**************/
    virtual ~HighScoreEntry();

    /*********************/
    /* GET A PLAYER NAME */
    /*********************/
    // Pass pointer to place to store name in name.
    // Pass pointer to controls to read in controls.
    // Pass pointer to Gameduino to display on in gd.
    void GetName( PlayerName *name, PanelControls *controls, Gameduino *gd );

private :

    // Position of cursor (zero for first character).
    UInt8 cursorPos;

    /*********************/
    /* WAIT FOR CONTROLS */
    /*********************/
    // Pass pointer to Gameduino to display on in gd.
    // Pass pointer to controls to read in controls.
    // Pass true in waitActivate to wait for a control to be used.
    // Pass false to wait for release.
    void WaitControls( Gameduino *gd, PanelControls *controls, bool waitActivate );

    /*******************/
    /* DRAW THE SCREEN */
    /*******************/
    // Pass pointer to Gameduino to display on in gd.
    void DrawScreen( Gameduino *gd );    

    /***************************/
    /* DRAW THE CHARACTER GRID */
    /***************************/
    // Pass pointer to Gameduino to draw on in gd.
    void DrawGrid( Gameduino *gd );

    /********************************/
    /* DRAW THE NAME AND THE CURSOR */
    /********************************/
    // Pass pointer to Gameduino to display on in gd.
    // Pass player name in name.
    void DrawName( Gameduino *gd, PlayerName *name );
    
    /********************/
    /* UPDATE ANIMATION */
    /********************/
    // Pass pointer to Gameduino to display on in gd.
    void Animate( Gameduino *gd );

  };

#endif

/* END of HighScoreEntry.h */