Snake vs Block Game to be run upon K64F.

Dependencies:   mbed

Committer:
AhmedPlaymaker
Date:
Mon May 06 16:15:21 2019 +0000
Revision:
84:9950d561fdf8
Parent:
83:329da564799a
Child:
90:741120c09784
Added some more comments to describe what some of my functions and methods do.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AhmedPlaymaker 33:249cf423fb18 1 #ifndef Stats_H
AhmedPlaymaker 33:249cf423fb18 2 #define Stats_H
AhmedPlaymaker 33:249cf423fb18 3
AhmedPlaymaker 33:249cf423fb18 4 #include "mbed.h"
AhmedPlaymaker 33:249cf423fb18 5 #include "N5110.h"
AhmedPlaymaker 33:249cf423fb18 6 #include "Gamepad.h"
AhmedPlaymaker 33:249cf423fb18 7 #include "SDFileSystem.h"
AhmedPlaymaker 33:249cf423fb18 8
AhmedPlaymaker 33:249cf423fb18 9 class Stats
AhmedPlaymaker 33:249cf423fb18 10 {
AhmedPlaymaker 84:9950d561fdf8 11 public:
AhmedPlaymaker 84:9950d561fdf8 12
AhmedPlaymaker 33:249cf423fb18 13 Stats();
AhmedPlaymaker 33:249cf423fb18 14 ~Stats();
AhmedPlaymaker 84:9950d561fdf8 15
AhmedPlaymaker 83:329da564799a 16 /** Initialise Stats
AhmedPlaymaker 83:329da564799a 17 *
AhmedPlaymaker 83:329da564799a 18 * This function passes the pointers to the stats class so that it can control the screen and the gamepad.
AhmedPlaymaker 83:329da564799a 19 */
AhmedPlaymaker 83:329da564799a 20 void init(N5110 *lcd, Gamepad *pad);
AhmedPlaymaker 84:9950d561fdf8 21
AhmedPlaymaker 33:249cf423fb18 22 /** Stats Display
AhmedPlaymaker 33:249cf423fb18 23 *
AhmedPlaymaker 33:249cf423fb18 24 * This function is used to configure stats.
AhmedPlaymaker 33:249cf423fb18 25 */
AhmedPlaymaker 83:329da564799a 26 void StatsDisplay();
AhmedPlaymaker 84:9950d561fdf8 27
AhmedPlaymaker 33:249cf423fb18 28 /** write
AhmedPlaymaker 33:249cf423fb18 29 *
AhmedPlaymaker 33:249cf423fb18 30 * This function is used to write to the file
AhmedPlaymaker 33:249cf423fb18 31 */
AhmedPlaymaker 33:249cf423fb18 32 void write(int level, SDFileSystem &sd);
AhmedPlaymaker 84:9950d561fdf8 33
AhmedPlaymaker 33:249cf423fb18 34 /** Read
AhmedPlaymaker 33:249cf423fb18 35 *
AhmedPlaymaker 33:249cf423fb18 36 * This function is used to read from the file
AhmedPlaymaker 33:249cf423fb18 37 */
AhmedPlaymaker 33:249cf423fb18 38 void read(SDFileSystem &sd);
AhmedPlaymaker 84:9950d561fdf8 39
AhmedPlaymaker 33:249cf423fb18 40 /** delete file
AhmedPlaymaker 33:249cf423fb18 41 *
AhmedPlaymaker 33:249cf423fb18 42 * This function allows us to delete the file
AhmedPlaymaker 33:249cf423fb18 43 */
AhmedPlaymaker 33:249cf423fb18 44 void delete_file(char filename[]);
AhmedPlaymaker 84:9950d561fdf8 45
AhmedPlaymaker 84:9950d561fdf8 46
AhmedPlaymaker 33:249cf423fb18 47 char bufferlevel[14]; //this helps me print the highest level on screen.
AhmedPlaymaker 84:9950d561fdf8 48
AhmedPlaymaker 84:9950d561fdf8 49 private:
AhmedPlaymaker 33:249cf423fb18 50 int _stored_top_level;
AhmedPlaymaker 33:249cf423fb18 51 int _current_level;
AhmedPlaymaker 33:249cf423fb18 52 int _top_level;
AhmedPlaymaker 84:9950d561fdf8 53
AhmedPlaymaker 83:329da564799a 54 //Pointer to the game pad object pad.
AhmedPlaymaker 83:329da564799a 55 Gamepad *_pad;
AhmedPlaymaker 83:329da564799a 56 //Pointer to the N5110 object lcd.
AhmedPlaymaker 83:329da564799a 57 N5110 *_lcd;
AhmedPlaymaker 84:9950d561fdf8 58
AhmedPlaymaker 33:249cf423fb18 59
AhmedPlaymaker 33:249cf423fb18 60 };
AhmedPlaymaker 33:249cf423fb18 61 #endif