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
Diff: Menu/Menu.cpp
- Revision:
- 9:fff2009f826e
- Child:
- 10:8bf3713d9e9c
diff -r 5327418f823a -r fff2009f826e Menu/Menu.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Menu/Menu.cpp Sun Mar 24 19:22:50 2019 +0000
@@ -0,0 +1,23 @@
+#include "Menu.h"
+
+Menu::Menu() {}
+
+Menu::~Menu() {}
+
+void Menu::init() {
+ _game_engine.init();
+ _game_counter = 0;
+}
+
+void Menu::run_game_engine(N5110 &lcd, Gamepad &gamepad) {
+ _game_engine.check_reset();
+ _game_engine.read_input(gamepad);
+ if (_game_counter % 10 == 0) _game_engine.generate_map();
+ _game_engine.find_level();
+ _game_engine.process_y();
+ _game_engine.process_x(_game_counter);
+ _game_engine.process_sprite();
+ _game_engine.update_lcd(lcd);
+ _game_counter++;
+ if(_game_counter == 100) _game_counter = 0;
+}
\ No newline at end of file