![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
All there but errors need fixing
Dependencies: mbed
Overview:
Rookie Tetris is a jigsaw style game based on the classic Tetris.
A block will appear at the top of the screen, you must move it (your options for movement are left, right and down - you cannot move up the board). The block will stop when it if placed either on the floor of the board or on-top of another block.
Your goal is to fill a complete row of the board with the blocks; when you do so the row will delete and the pattern above it will drop down. The game is over when your pattern is tall enough to reach to the top of the board!
Controls:
Use the joystick to move your block! Your block cannot move out of the parameters of the board.
Pot 2 controls the contrast of the screen.
TetrisGame/TetrisGame.h
- Committer:
- el18rs
- Date:
- 2020-05-24
- Revision:
- 3:522c6f850e91
- Child:
- 4:7ddd287a5d28
File content as of revision 3:522c6f850e91:
#ifndef TETRISGAME_H #define TETRISGAME_H #include "mbed.h" #include "N5110.h" #include "Gamepad.h" #include "Tetromino.h" #define GAP 0 class TetrisGame { public: TetrisGame(); ~TetrisGame(); void init(int tetromino_width, int tetromino_height, int tetromino_size, int speed); void read_input(Gamepad &pad); void update(Gamepad &pad); void draw(N5110 &lcd); private: void check_wall_collision(Gamepad &pad); void check_tetromino_collision(Gamepad &pad); void check_goal(Gamepad &pad); Tetromino _p1; int _tetromino_width; int _tetromino_height; int _tetromino_size; int _speed; int _p1x; Tetromino _tetromino; Direction _d; float _mag; }; #endif