ELEC2645 (2017/18) / Mbed OS el16ajm
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?

UserRevisionLine numberNew 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 };