summaryrefslogtreecommitdiff
path: root/Menu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Menu.cpp')
-rw-r--r--Menu.cpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/Menu.cpp b/Menu.cpp
new file mode 100644
index 0000000..06d5c18
--- /dev/null
+++ b/Menu.cpp
@@ -0,0 +1,54 @@
+/* **************************************
+ * Includes *
+ * **************************************/
+
+#include "Menu.h"
+
+/* **************************************
+ * Defines *
+ * **************************************/
+
+/* **************************************
+ * Local variables *
+ * **************************************/
+
+static const char MainMenuOption_0[] PROGMEM = "Single player game";
+static const char MainMenuOption_1[] PROGMEM = "Multiplayer game";
+static const char MainMenuOption_2[] PROGMEM = "Options";
+static const char MainMenuOption_3[] PROGMEM = "Quit";
+
+static const char * const MainMenuOptions[] PROGMEM = { MainMenuOption_0,
+ MainMenuOption_1,
+ MainMenuOption_2,
+ MainMenuOption_3 };
+
+void MenuGetPlayerName(Player * ptrPlayer)
+{
+ memset(ptrPlayer->getName(), 0, PLAYER_NAME_LENGTH);
+ gb.getDefaultName(ptrPlayer->getName());
+}
+
+void MainMenu(void)
+{
+ //int8_t menu(const char* const* items, uint8_t length);
+
+ uint8_t choice = gb.menu(MainMenuOptions, 3);
+
+ switch(choice)
+ {
+ case 0:
+ MenuGetPlayerName(&GamePlayers[0]);
+ GameInit();
+ break;
+ case 1:
+ break;
+ break;
+ case 2:
+
+ break;
+
+ default:
+ break;
+ }
+
+}