Class used to run the maze game loop.
MazeEngine.cpp
- Committer:
- el15mh
- Date:
- 2017-04-07
- Revision:
- 0:afee1085c5ef
- Child:
- 1:5a44ce88c5e2
File content as of revision 0:afee1085c5ef:
/* @file mazeEngine.cpp (c) Max Houghton 19.03.2017 Roller Maze Project, ELEC2645, Univeristy of Leeds */ #include "MazeEngine.h" MazeEngine::MazeEngine() { } MazeEngine::~MazeEngine() { } void MazeEngine::init(int mazeIndex, int x, int y, int radius) { // maze parameters _mazeIndex = mazeIndex; // ball parameters _radius = radius; _x = x; _y = y; // initialise ball & maze with parameters _ball.init(_x, _y, _radius); _maze.init(_mazeIndex); } void MazeEngine::readInput(Gamepad &pad, FXOS8700CQ &device) { // acquire input from devices _direction = pad.get_direction(); // direction is a 2D struct _magnitude = pad.get_mag(); /* else { _direction = devie. } */ } void MazeEngine::update(Gamepad &pad, N5110 &lcd) { _ball.update(); } void MazeEngine::draw(N5110 &lcd) { _ball.draw(lcd); _maze.draw(lcd); }