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

Committer:
RichardE
Date:
Mon Jun 17 15:10:43 2013 +0000
Revision:
18:70190f956a24
Parent:
4:673eb9735d44
Improved response to button 1 when entering high scores (HighScoreEntry.cpp).

Who changed what in which revision?

UserRevisionLine numberNew contents of line
RichardE 4:673eb9735d44 1 /*
RichardE 4:673eb9735d44 2 * SOURCE FILE : Random.h
RichardE 4:673eb9735d44 3 *
RichardE 4:673eb9735d44 4 * Definition of class Random.
RichardE 4:673eb9735d44 5 * Generates random numbers a bit like the random function used by Arduino and Maple and so on.
RichardE 4:673eb9735d44 6 *
RichardE 4:673eb9735d44 7 */
RichardE 4:673eb9735d44 8
RichardE 4:673eb9735d44 9 #ifndef RandomDefined
RichardE 4:673eb9735d44 10
RichardE 4:673eb9735d44 11 #define RandomDefined
RichardE 4:673eb9735d44 12
RichardE 4:673eb9735d44 13 #include <stdlib.h>
RichardE 4:673eb9735d44 14
RichardE 4:673eb9735d44 15 class Random {
RichardE 4:673eb9735d44 16
RichardE 4:673eb9735d44 17 public :
RichardE 4:673eb9735d44 18
RichardE 4:673eb9735d44 19 /***********************/
RichardE 4:673eb9735d44 20 /* GET A RANDOM NUMBER */
RichardE 4:673eb9735d44 21 /***********************/
RichardE 4:673eb9735d44 22 // Get a random number between min and max.
RichardE 4:673eb9735d44 23 // Result may be equal to min but is always less than max.
RichardE 4:673eb9735d44 24 static long Get( long min, long max ) {
RichardE 4:673eb9735d44 25 return min + ( rand() % ( max - min ) );
RichardE 4:673eb9735d44 26 }
RichardE 4:673eb9735d44 27
RichardE 4:673eb9735d44 28 /***********************/
RichardE 4:673eb9735d44 29 /* GET A RANDOM NUMBER */
RichardE 4:673eb9735d44 30 /***********************/
RichardE 4:673eb9735d44 31 static long Get( long max ) {
RichardE 4:673eb9735d44 32 return Get( 0L, max );
RichardE 4:673eb9735d44 33 }
RichardE 4:673eb9735d44 34
RichardE 4:673eb9735d44 35 };
RichardE 4:673eb9735d44 36
RichardE 4:673eb9735d44 37 #endif
RichardE 4:673eb9735d44 38
RichardE 4:673eb9735d44 39 /* END of Random.h */
RichardE 4:673eb9735d44 40