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
Fork of el17ajf by
Diff: Game/Game.cpp
- Revision:
- 4:aa433f9865a6
- Parent:
- 2:0b5e289ef905
- Child:
- 5:3efbdcb3efaf
--- a/Game/Game.cpp Tue Mar 12 16:37:43 2019 +0000 +++ b/Game/Game.cpp Tue Mar 12 20:03:31 2019 +0000 @@ -1,4 +1,4 @@ -#define "Game.h" +#include "Game.h" Game::Game() { @@ -13,11 +13,25 @@ } void Game::update() { - + if (false /* Input::getLeft */) { + if (grid.isSpaceForTetrimino(currentTetromino.movedLeft()) { + currentTetromino = currentTetromino.movedLeft(); + } + } +} + +void MoveDownORWhatever() { + if (grid.isSpaceForTetrimino(currentTetromino.movedDown()) { + currentTetromino = currentTetromino.movedDown(); + } else { + grid::placeTetromino(currentTetrimino); + currentTetrimino = Tetrimino(); + } } void Game::draw() { - + currentTetrimino.draw(); + grid.draw(); } void Game::nextLevel() {