Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed N5110 ShiftReg PinDetect
Diff: SubmitHighscore.h
- Revision:
- 17:d6a3b29cab31
- Child:
- 18:709ea375b0df
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SubmitHighscore.h Mon May 11 03:52:18 2015 +0000
@@ -0,0 +1,41 @@
+#ifndef SUBMIT_HIGHSCORE_H
+#define SUBMIT_HIGHSCORE_H
+
+#include "State.h"
+#include "Global.h"
+#include <cstdlib>
+#include <string>
+#include <sstream>
+
+/// @file SubmitHighscore.h
+
+/// State: Submit Highscore
+/// Displays a screen where the user is promted to input his or her initials
+class SubmitHighscore : public State
+{
+ public:
+ SubmitHighscore(StateManager* fsm, N5110 *lcd, InputManager* input, Sound* sound)
+ : State(fsm, lcd, input, sound) {init();}
+
+ void init();
+ virtual void update(float dt); /// Update logic
+ virtual void render(); /// Draw to screen
+
+ private:
+ static void btnAPress(); /// Interrupt callback function when button A is pressed
+ static void btnBPress(); /// Interrupt callback function when button B is pressed
+ static void btnCPress(); /// Interrupt callback function when button C is pressed
+
+
+ private:
+ enum SubmitHighscoreState{LETTER1, LETTER2, LETTER3, SEL_SUBMIT, WRITE_TO_FILE, LOAD_GAME_OVER};
+ static int currentState;
+ /** Changes the current selected letter.
+ * @param index The index of the letter to be changed (0, 1 or 2)
+ * @param next Goes to the next letter in the alphabet if true. Goes to the previous letter if false.
+ */
+ static void changeLetter(int index, bool next);
+ static int letters[3];
+};
+
+#endif
\ No newline at end of file