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: Spikes.cpp
- Revision:
- 10:6c574b8524df
- Parent:
- 9:2836fc3d9ede
--- a/Spikes.cpp Mon May 18 12:41:06 2020 +0000 +++ b/Spikes.cpp Mon May 18 13:12:35 2020 +0000 @@ -43,7 +43,7 @@ _y = 1; } if (x == 2){ - _x = rand() % 78 + 42; + _x = rand() % 37 + 42; _y = 1; } } @@ -56,4 +56,12 @@ Vector2D Spikes::get_pos() { Vector2D p = {_x,_y}; return p; -} \ No newline at end of file +} + +void Spikes::hit(Gamepad &pad) +{ + pad.led(1,1); + pad.led(4,1); +} + + \ No newline at end of file