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.
Engine/Engine.h@2:9ca5e1c221c3, 2018-04-16 (annotated)
- Committer:
- Andrew_M
- Date:
- Mon Apr 16 10:55:00 2018 +0000
- Revision:
- 2:9ca5e1c221c3
- Parent:
- 1:a14415de3ad5
- Child:
- 3:6253a2d374fa
Basic drawing of the game works, snake is currently incorrectly drawn. Overall skeleton of the software is done but not much more
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Andrew_M | 1:a14415de3ad5 | 1 | #include "mbed.h" |
Andrew_M | 1:a14415de3ad5 | 2 | #include "N5110.h" |
Andrew_M | 1:a14415de3ad5 | 3 | #include "Gamepad.h" |
Andrew_M | 1:a14415de3ad5 | 4 | #include "Snek.h" |
Andrew_M | 1:a14415de3ad5 | 5 | |
Andrew_M | 1:a14415de3ad5 | 6 | class Engine |
Andrew_M | 1:a14415de3ad5 | 7 | { |
Andrew_M | 1:a14415de3ad5 | 8 | |
Andrew_M | 1:a14415de3ad5 | 9 | public: |
Andrew_M | 1:a14415de3ad5 | 10 | Engine(); |
Andrew_M | 1:a14415de3ad5 | 11 | ~Engine(); |
Andrew_M | 1:a14415de3ad5 | 12 | |
Andrew_M | 1:a14415de3ad5 | 13 | void init(); |
Andrew_M | 1:a14415de3ad5 | 14 | void read_input(Gamepad &pad); |
Andrew_M | 1:a14415de3ad5 | 15 | void update(Gamepad &pad); |
Andrew_M | 1:a14415de3ad5 | 16 | void draw(N5110 &lcd); |
Andrew_M | 1:a14415de3ad5 | 17 | |
Andrew_M | 1:a14415de3ad5 | 18 | private: |
Andrew_M | 1:a14415de3ad5 | 19 | |
Andrew_M | 1:a14415de3ad5 | 20 | Direction _d; |
Andrew_M | 1:a14415de3ad5 | 21 | float _mag; |
Andrew_M | 2:9ca5e1c221c3 | 22 | int _grid[22][22]; |
Andrew_M | 2:9ca5e1c221c3 | 23 | Snek _solid; |
Andrew_M | 1:a14415de3ad5 | 24 | }; |