![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
All there but errors need fixing
TetrisGame/TetrisGame.h@4:7ddd287a5d28, 2020-05-31 (annotated)
- Committer:
- el18rs
- Date:
- Sun May 31 17:01:53 2020 +0000
- Revision:
- 4:7ddd287a5d28
- Parent:
- 3:522c6f850e91
Includes most parts but still has errors that need fixing
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el18rs | 3:522c6f850e91 | 1 | #ifndef TETRISGAME_H |
el18rs | 3:522c6f850e91 | 2 | #define TETRISGAME_H |
el18rs | 3:522c6f850e91 | 3 | |
el18rs | 3:522c6f850e91 | 4 | #include "mbed.h" |
el18rs | 3:522c6f850e91 | 5 | #include "N5110.h" |
el18rs | 3:522c6f850e91 | 6 | #include "Gamepad.h" |
el18rs | 3:522c6f850e91 | 7 | #include "Tetromino.h" |
el18rs | 3:522c6f850e91 | 8 | |
el18rs | 3:522c6f850e91 | 9 | class TetrisGame |
el18rs | 3:522c6f850e91 | 10 | { |
el18rs | 3:522c6f850e91 | 11 | |
el18rs | 3:522c6f850e91 | 12 | public: |
el18rs | 3:522c6f850e91 | 13 | TetrisGame(); |
el18rs | 3:522c6f850e91 | 14 | ~TetrisGame(); |
el18rs | 3:522c6f850e91 | 15 | |
el18rs | 4:7ddd287a5d28 | 16 | void init(int number, int x, int y, int speed); |
el18rs | 3:522c6f850e91 | 17 | void read_input(Gamepad &pad); |
el18rs | 3:522c6f850e91 | 18 | void update(Gamepad &pad); |
el18rs | 3:522c6f850e91 | 19 | void draw(N5110 &lcd); |
el18rs | 4:7ddd287a5d28 | 20 | //void play_game(); |
el18rs | 4:7ddd287a5d28 | 21 | void exit_game(); |
el18rs | 4:7ddd287a5d28 | 22 | void cancel_line(); |
el18rs | 3:522c6f850e91 | 23 | |
el18rs | 3:522c6f850e91 | 24 | private: |
el18rs | 3:522c6f850e91 | 25 | |
el18rs | 3:522c6f850e91 | 26 | void check_wall_collision(Gamepad &pad); |
el18rs | 4:7ddd287a5d28 | 27 | void check_tetromino_collisions(); |
el18rs | 4:7ddd287a5d28 | 28 | // void check_score(Gamepad &pad); |
el18rs | 4:7ddd287a5d28 | 29 | |
el18rs | 4:7ddd287a5d28 | 30 | // void cancel_line(N5110 &lcd); |
el18rs | 4:7ddd287a5d28 | 31 | // void gameover(N5110 &lcd); |
el18rs | 3:522c6f850e91 | 32 | |
el18rs | 3:522c6f850e91 | 33 | Tetromino _p1; |
el18rs | 3:522c6f850e91 | 34 | |
el18rs | 4:7ddd287a5d28 | 35 | int _number; |
el18rs | 4:7ddd287a5d28 | 36 | int _x; |
el18rs | 4:7ddd287a5d28 | 37 | int _y; |
el18rs | 3:522c6f850e91 | 38 | int _speed; |
el18rs | 4:7ddd287a5d28 | 39 | int blocknumber; |
el18rs | 4:7ddd287a5d28 | 40 | int blockArray[5]; |
el18rs | 3:522c6f850e91 | 41 | |
el18rs | 4:7ddd287a5d28 | 42 | //_old_tetromino; |
el18rs | 4:7ddd287a5d28 | 43 | |
el18rs | 4:7ddd287a5d28 | 44 | // int _p1x; |
el18rs | 3:522c6f850e91 | 45 | |
el18rs | 3:522c6f850e91 | 46 | Tetromino _tetromino; |
el18rs | 3:522c6f850e91 | 47 | |
el18rs | 3:522c6f850e91 | 48 | Direction _d; |
el18rs | 3:522c6f850e91 | 49 | float _mag; |
el18rs | 3:522c6f850e91 | 50 | }; |
el18rs | 3:522c6f850e91 | 51 | |
el18rs | 3:522c6f850e91 | 52 | #endif |