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: 4DGL-uLCD-SE PinDetect SDFileSystem mbed-rtos mbed wave_player
Revision 3:642d90f34496, committed 2014-03-24
- Comitter:
- jmelliadis3
- Date:
- Mon Mar 24 19:23:12 2014 +0000
- Parent:
- 2:22aa1c22ec77
- Commit message:
- Initial Flappy mbed Game!
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Mar 24 15:04:47 2014 +0000
+++ b/main.cpp Mon Mar 24 19:23:12 2014 +0000
@@ -115,6 +115,7 @@
uLCD.printf("%04d", score);
int go = 1;
+ int scoreWrite = 1;
while(go) {
switch (state) {
@@ -174,6 +175,14 @@
wall1y2 = rand() % (73) + 8;
wall2y1 = wall1y2 + 48;
+ scoreWrite = 1;
+ }
+
+ if(wall1x2 < 95 && scoreWrite == 1)
+ {
+ uLCD.locate(14,0);
+ uLCD.printf("%04d", score);
+ scoreWrite = 0;
}