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: CrossyChicken/CrossyChicken.cpp
- Revision:
- 15:b15bf9357cd9
- Parent:
- 13:cd6d2f999057
- Child:
- 16:8a65cccd9685
--- a/CrossyChicken/CrossyChicken.cpp Wed May 13 17:17:57 2020 +0000
+++ b/CrossyChicken/CrossyChicken.cpp Wed May 13 22:05:17 2020 +0000
@@ -53,6 +53,8 @@
graphics.contrast();
graphics.backLightOn();
gamepad.init();
+ row_number = 1;
+
//first lane of left racers
firstLane[0].setSeperation(0);
@@ -204,6 +206,20 @@
}
}
+// every level is going to have the same
+// 4 lanes of roads
+void CrossyChicken::drawRoadBackground()
+{
+ RoadObjects temp;
+ int grid_screen_width = 22; // number of visible widths on width screen
+
+ for(int i = 0; i < 4; i++){
+ graphics.drawRoads(row_number);
+
+ }
+ row_number++;
+}
+
// make the frog move same speed as log
// if the frog moves then detach
void CrossyChicken::frogOnLog(Car *log) {