ECE2035 Project 2

Dependencies:   mbed mbed-rtos SDFileSystem

Revision:
7:95db0d89fbac
Parent:
5:b9b7993823e1
Child:
9:f1d34ef049c5
--- a/player.cpp	Thu Apr 08 16:44:39 2021 +0000
+++ b/player.cpp	Fri Apr 09 13:49:01 2021 +0000
@@ -9,6 +9,7 @@
 //==================================================================
 #include "player_private.h"
 #include "globals.h"
+#include "compost_pile_public.h";
 #define X 0xFFFFFF //WHITE
 #define PLAYER_WIDTH 15
 #define KNIFE_HEIGHT 2
@@ -103,8 +104,8 @@
     if (y_pos < 10) {
         y_pos = 10;   
     }
-    if (y_pos > 105) {
-        y_pos = 105;
+    if (y_pos > 112 - (get_compost_tallest_height() * 11)) {
+        y_pos = 112 - (get_compost_tallest_height() * 11);
     }
     int y_prev = player.y;
     player.y = y_pos;