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:
- 16:8a65cccd9685
- Parent:
- 15:b15bf9357cd9
- Child:
- 17:67dbdfcdcec2
diff -r b15bf9357cd9 -r 8a65cccd9685 CrossyChicken/CrossyChicken.cpp
--- a/CrossyChicken/CrossyChicken.cpp Wed May 13 22:05:17 2020 +0000
+++ b/CrossyChicken/CrossyChicken.cpp Wed May 13 23:07:05 2020 +0000
@@ -207,17 +207,44 @@
}
// 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
+ // 4 lanes of roads
for(int i = 0; i < 4; i++){
graphics.drawRoads(row_number);
+ row_number++;
+ }
+}
+
+// we are going to have two safety lanes
+void CrossyChicken::drawSafetyLanes()
+{
+ int state = 1;
+
+ for(int x = 0; x < 22; x++){
+ // fsm for drawing safety lane background
+ switch(state)
+ {
+ case 1:
+ graphics.drawFirstSafetyBackground(x, 0); // safety lane so row 0
+ graphics.drawFirstSafetyBackground(x, 6); // middle lane so row 6
+ state++;
+ break;
+ case 2:
+ graphics.drawSecondSafetyBackground(x, 0); // safety lane so row 0
+ graphics.drawSecondSafetyBackground(x, 6); // middle lane so row 6
+ state -= 1; // back to inital state
+ break;
+ }
+ }
+}
- }
- row_number++;
+void CrossyChicken::drawWater()
+{
+
+
}
// make the frog move same speed as log