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: Body/Body.cpp
- Revision:
- 8:59b01b57f0da
- Parent:
- 5:e0f08e8022de
- Child:
- 9:f3259d652208
diff -r 24a3f13ce36d -r 59b01b57f0da Body/Body.cpp
--- a/Body/Body.cpp Sun May 31 14:12:45 2020 +0000
+++ b/Body/Body.cpp Sun May 31 16:06:31 2020 +0000
@@ -29,4 +29,12 @@
for (int k = 0; k < _nbody; k++){ //Snake tail
lcd.drawRect(bodyx[k], bodyy[k], 2, 2, FILL_BLACK);
}
- }
\ No newline at end of file
+ }
+
+ Vector2D Body::get_pos() {
+
+ for (int j = 0; j < _nbody; j++) {
+ Vector2D b = {bodyx[j], bodyy[j]};
+ return b;
+}
+}
\ No newline at end of file