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:
- 17:ce6b54422113
- Parent:
- 16:37d98c281eb3
- Child:
- 18:ba4159ab4da7
diff -r 37d98c281eb3 -r ce6b54422113 main.cpp
--- a/main.cpp Wed May 08 09:05:27 2019 +0000
+++ b/main.cpp Wed May 08 13:03:24 2019 +0000
@@ -24,27 +24,28 @@
int main(){
int fps = 30;
- int lives = 0;
-
lcd.setContrast(0.4);
lcd.setBrightness(0.5);
init();
- game.death(lives);
startScreen();
- game.UI(pad,lcd);
- render();
+ //game.UI(pad,lcd);
+ //render();
wait(1.0f/fps);
-
- while (1) {
- render();
- wait(1.0f/fps);
- }
+ while (1) {
+ game.UI(pad,lcd);
+ game.init();
+ int lives = game.get_lives();
+ while (lives > 0) {
+ render();
+ wait(1.0f/fps);
+ lives = game.get_lives();
+ }
+ }
}
void init(){
lcd.init();
pad.init();
- game.init();
}
void render(){
@@ -54,6 +55,7 @@
game.movement(pad,lcd);
game.collect(lcd, pad);
game.damage(lcd,pad);
+ game.death(lcd,pad);
lcd.refresh();
}