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: main.cpp
- Revision:
- 15:2bda80896a84
- Parent:
- 14:dc3524d11921
- Child:
- 16:8384e9a480ef
--- a/main.cpp Fri Mar 29 00:30:03 2019 +0000 +++ b/main.cpp Fri Mar 29 19:03:10 2019 +0000 @@ -5,10 +5,7 @@ #include "Levelengine.h" #include "Gameengine.h" -Vector2D p; Gameengine game; -Levelengine level; -Minerengine miner; Gamepad pad; N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11); AnalogIn pot0(PTB2); @@ -16,28 +13,21 @@ void contrast(); void init(); void start_screen(); +void render(); int main() { init(); start_screen(); - miner.miner_init(); + while (1) { contrast(); - miner.get_pos(); - level.central_cavern(lcd); - miner.miner_gravity(lcd); - miner.miner_jump(lcd, pad); - miner.read_direction(pad); - miner.miner_move(); - miner.miner_draw(lcd); - miner.miner_collision(lcd); - level.collision_points(lcd, pad); - game.collision(); - + render(); + game.read_direction(pad); + game.update(lcd, pad); wait(0.1); @@ -54,8 +44,12 @@ pad.init(); pad.leds_off(); contrast(); - + game.game_init(); +} +void render() +{ + game.draw(lcd); } void contrast()