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: Floors/Floors.cpp
- 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);
}