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 Gamepad N5110
snake/snake.h@0:b67614a0c4cf, 2019-04-02 (annotated)
- Committer:
 - 694617778
 - Date:
 - Tue Apr 02 06:46:47 2019 +0000
 - Revision:
 - 0:b67614a0c4cf
 - Child:
 - 1:b49c36604125
 
test
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| 694617778 | 0:b67614a0c4cf | 1 | #include "mbed.h" | 
| 694617778 | 0:b67614a0c4cf | 2 | #include "N5110.h" | 
| 694617778 | 0:b67614a0c4cf | 3 | #include "Gamepad.h" | 
| 694617778 | 0:b67614a0c4cf | 4 | |
| 694617778 | 0:b67614a0c4cf | 5 | class snake | 
| 694617778 | 0:b67614a0c4cf | 6 | { | 
| 694617778 | 0:b67614a0c4cf | 7 | |
| 694617778 | 0:b67614a0c4cf | 8 | public: | 
| 694617778 | 0:b67614a0c4cf | 9 | snake(); | 
| 694617778 | 0:b67614a0c4cf | 10 | ~snake(); | 
| 694617778 | 0:b67614a0c4cf | 11 | void update(); | 
| 694617778 | 0:b67614a0c4cf | 12 | void init(int x,int y,int size,int speed); | 
| 694617778 | 0:b67614a0c4cf | 13 | void draw(N5110 &lcd); | 
| 694617778 | 0:b67614a0c4cf | 14 | void add_score(); | 
| 694617778 | 0:b67614a0c4cf | 15 | int get_score(); | 
| 694617778 | 0:b67614a0c4cf | 16 | Vector2D get_pos(); | 
| 694617778 | 0:b67614a0c4cf | 17 | |
| 694617778 | 0:b67614a0c4cf | 18 | private: | 
| 694617778 | 0:b67614a0c4cf | 19 | |
| 694617778 | 0:b67614a0c4cf | 20 | Vector2D _velocity; | 
| 694617778 | 0:b67614a0c4cf | 21 | int _size; | 
| 694617778 | 0:b67614a0c4cf | 22 | int _x; | 
| 694617778 | 0:b67614a0c4cf | 23 | int _y; | 
| 694617778 | 0:b67614a0c4cf | 24 | int _score; | 
| 694617778 | 0:b67614a0c4cf | 25 | |
| 694617778 | 0:b67614a0c4cf | 26 | }; |