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.
Player/Player.h@8:21b6d4dbce44, 2019-04-19 (annotated)
- Committer:
- joshdavy
- Date:
- Fri Apr 19 17:54:09 2019 +0000
- Revision:
- 8:21b6d4dbce44
- Parent:
- 7:68e06dda79f7
- Child:
- 9:96969b1c6bde
Main menu added.;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
joshdavy | 3:b34685dbdb8d | 1 | #ifndef PLAYER_H |
joshdavy | 3:b34685dbdb8d | 2 | #define PLAYER_H |
joshdavy | 3:b34685dbdb8d | 3 | |
joshdavy | 3:b34685dbdb8d | 4 | #include "mbed.h" |
joshdavy | 3:b34685dbdb8d | 5 | #include "N5110.h" |
joshdavy | 3:b34685dbdb8d | 6 | #include "Gamepad.h" |
joshdavy | 3:b34685dbdb8d | 7 | #include "Bitmap.h" |
joshdavy | 3:b34685dbdb8d | 8 | #include "Sprite.h" |
joshdavy | 7:68e06dda79f7 | 9 | #include "Level.h" |
joshdavy | 8:21b6d4dbce44 | 10 | #include "PlayerMap.h" |
joshdavy | 3:b34685dbdb8d | 11 | |
joshdavy | 3:b34685dbdb8d | 12 | #define GRAVITY 2 |
joshdavy | 3:b34685dbdb8d | 13 | /*Sprite Class*/ |
joshdavy | 3:b34685dbdb8d | 14 | |
joshdavy | 3:b34685dbdb8d | 15 | //extern N5110 lcd; |
joshdavy | 3:b34685dbdb8d | 16 | |
joshdavy | 3:b34685dbdb8d | 17 | class Player : public Sprite{ |
joshdavy | 3:b34685dbdb8d | 18 | |
joshdavy | 3:b34685dbdb8d | 19 | public: |
joshdavy | 3:b34685dbdb8d | 20 | Player(); |
joshdavy | 3:b34685dbdb8d | 21 | ~Player(); |
joshdavy | 7:68e06dda79f7 | 22 | void update(Gamepad &pad, Block blocks [],int number_of_blocks); |
joshdavy | 8:21b6d4dbce44 | 23 | void init(int height,int width,Vector2D pos); |
joshdavy | 8:21b6d4dbce44 | 24 | |
joshdavy | 8:21b6d4dbce44 | 25 | bool can_move_up(Block blocks [],int number_of_blocks); |
joshdavy | 8:21b6d4dbce44 | 26 | bool can_move_down(Block blocks [],int number_of_blocks); |
joshdavy | 8:21b6d4dbce44 | 27 | bool can_move_left(Block blocks [],int number_of_blocks); |
joshdavy | 8:21b6d4dbce44 | 28 | bool can_move_right(Block blocks [],int number_of_blocks); |
joshdavy | 7:68e06dda79f7 | 29 | |
joshdavy | 7:68e06dda79f7 | 30 | private: |
joshdavy | 7:68e06dda79f7 | 31 | int _orientation; |
joshdavy | 8:21b6d4dbce44 | 32 | int _direction; |
joshdavy | 3:b34685dbdb8d | 33 | }; |
joshdavy | 3:b34685dbdb8d | 34 | |
joshdavy | 3:b34685dbdb8d | 35 | #endif |