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: engine/main.cpp
- Revision:
- 3:124a5eb55c77
- Parent:
- 2:a48df109588e
- Child:
- 4:a6ca44e29e97
diff -r a48df109588e -r 124a5eb55c77 engine/main.cpp
--- a/engine/main.cpp Mon Apr 30 23:29:45 2018 +0000
+++ b/engine/main.cpp Tue May 01 09:06:51 2018 +0000
@@ -37,7 +37,7 @@
// initialise the lcd and gamepad
lcd.init();
- lcd.setContrast(0.5);
+ lcd.setContrast(0.4);
pad.init ();
}
@@ -64,8 +64,7 @@
const int arrayNum[3] = {'4', '24', '44'};
int RandIndex = rand() % 3;
-// x_car = arrayNum[RandIndex];
- x_car = 24;
+ x_car = arrayNum[RandIndex];
y_car = 0;
//set score
@@ -89,6 +88,7 @@
x_player = x_player-20;
}
+//car cannot go further left than the left lane etc
if (x_player <4) {
x_player = 4;
}