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: Gameengine.cpp
- Revision:
- 15:2bda80896a84
- Parent:
- 14:dc3524d11921
- Child:
- 16:8384e9a480ef
diff -r dc3524d11921 -r 2bda80896a84 Gameengine.cpp
--- a/Gameengine.cpp Fri Mar 29 00:30:03 2019 +0000
+++ b/Gameengine.cpp Fri Mar 29 19:03:10 2019 +0000
@@ -8,6 +8,33 @@
{
}
-void Gameengine::collision()
+void Gameengine::game_init()
+{
+ _level_select = 1;
+ _miner.miner_init(3, 33);
+}
+
+void Gameengine::read_direction(Gamepad &pad)
+{
+ _d = pad.get_direction();
+}
+
+void Gameengine::update(N5110 &lcd, Gamepad &pad)
{
-}
\ No newline at end of file
+ _miner.miner_move(_d);
+ _miner.miner_gravity(lcd);
+ _miner.miner_jump(lcd, pad);
+ _miner.miner_land(lcd);
+ _miner.level_one_collision(lcd);
+}
+
+void Gameengine::draw(N5110 &lcd)
+{
+ if (_level_select == 1){
+
+ _miner.miner_draw(lcd);
+ _level.level_one(lcd);
+ _miner.level_one_collision(lcd);
+ }
+}
+
\ No newline at end of file