ELEC2645 (2018/19) / Mbed 2 deprecated el17m2h_public

Dependencies:   mbed

Revision:
12:c5123abb4fbe
Parent:
11:2041290b5a74
Child:
13:10851784af9a
--- a/Floors/Floors.cpp	Wed Apr 17 16:58:01 2019 +0000
+++ b/Floors/Floors.cpp	Wed Apr 17 17:53:27 2019 +0000
@@ -17,14 +17,12 @@
     lcd.drawRect(_pos.x, _pos.y, _width, _height, FILL_BLACK);
 }
 
-void Floors::update(Vector2D current_pos){
+void Floors::update(){
 // when they leave the screen they will re-appear in random x-coordinate so that 10 floors are always on screen
-    _pos = current_pos;
-    srand(time(0)); 
+    _pos = get_pos();
     if (_pos.y > 48 ){ 
     _pos.y = 0; 
-    _pos.x = rand()% 74; 
-    srand(time(0)); 
+    _pos.x = rand()% 74;
     }
     set_pos(_pos);
 }