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
SnakeTail/SnakeTail.h@11:c4b740a970f8, 2020-05-23 (annotated)
- Committer:
- sdlashmar
- Date:
- Sat May 23 10:50:43 2020 +0000
- Revision:
- 11:c4b740a970f8
- Parent:
- 7:c67a5c6a874f
- Child:
- 13:4fa0d5148216
tail logic working
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| sdlashmar | 5:256e5e0b6cd7 | 1 | #ifndef SNAKETAIL_H |
| sdlashmar | 5:256e5e0b6cd7 | 2 | #define SNAKETAIL_H |
| sdlashmar | 5:256e5e0b6cd7 | 3 | |
| sdlashmar | 5:256e5e0b6cd7 | 4 | #include "mbed.h" |
| sdlashmar | 5:256e5e0b6cd7 | 5 | #include "Gamepad.h" |
| sdlashmar | 5:256e5e0b6cd7 | 6 | #include "N5110.h" |
| sdlashmar | 7:c67a5c6a874f | 7 | #include "SnakeHead.h" |
| sdlashmar | 5:256e5e0b6cd7 | 8 | |
| sdlashmar | 5:256e5e0b6cd7 | 9 | class SnakeTail |
| sdlashmar | 5:256e5e0b6cd7 | 10 | |
| sdlashmar | 5:256e5e0b6cd7 | 11 | { |
| sdlashmar | 5:256e5e0b6cd7 | 12 | |
| sdlashmar | 5:256e5e0b6cd7 | 13 | public: |
| sdlashmar | 5:256e5e0b6cd7 | 14 | |
| sdlashmar | 5:256e5e0b6cd7 | 15 | SnakeTail(); |
| sdlashmar | 5:256e5e0b6cd7 | 16 | ~SnakeTail(); |
| sdlashmar | 7:c67a5c6a874f | 17 | void update(Vector2D headPos, int length); |
| sdlashmar | 7:c67a5c6a874f | 18 | void draw(N5110 &lcd, int length); |
| sdlashmar | 5:256e5e0b6cd7 | 19 | |
| sdlashmar | 5:256e5e0b6cd7 | 20 | |
| sdlashmar | 5:256e5e0b6cd7 | 21 | private: |
| sdlashmar | 5:256e5e0b6cd7 | 22 | |
| sdlashmar | 11:c4b740a970f8 | 23 | int tailX[100]; |
| sdlashmar | 11:c4b740a970f8 | 24 | int tailY[100]; |
| sdlashmar | 11:c4b740a970f8 | 25 | int _x_init, _y_init, prevX, prevY, prev2X, prev2Y, _length; |
| sdlashmar | 5:256e5e0b6cd7 | 26 | }; |
| sdlashmar | 5:256e5e0b6cd7 | 27 | |
| sdlashmar | 5:256e5e0b6cd7 | 28 | #endif |
| sdlashmar | 5:256e5e0b6cd7 | 29 |