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.
Diff: Engine/Engine.cpp
- Revision:
- 3:6253a2d374fa
- Parent:
- 2:9ca5e1c221c3
- Child:
- 4:6353f829c56c
--- a/Engine/Engine.cpp Mon Apr 16 10:55:00 2018 +0000 +++ b/Engine/Engine.cpp Sun Apr 29 14:19:38 2018 +0000 @@ -12,15 +12,14 @@ void Engine::init() // initialise the game parameters { - memset(_grid, 0, sizeof(_grid)); - + memset(_grid, 0, sizeof(_grid)); + _solid.init(3,5); } void Engine::read_input(Gamepad &pad) { _d = pad.get_direction(); - _mag = pad.get_mag(); } void Engine::draw(N5110 &lcd) @@ -37,11 +36,13 @@ void Engine::update(Gamepad &pad) { - memset(_grid, 0, sizeof(_grid)); - - //_grid[3][5] = 1; - + memset(_grid, 0, sizeof(_grid)); + + + _solid.update(_d); + int tempX = _solid.getX(); int tempY = _solid.getY(); + _grid[tempX][tempY] = 1; }