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:c3153fd4d8ce, 2019-04-25 (annotated)
- Committer:
- ll16o2l
- Date:
- Thu Apr 25 18:49:50 2019 +0000
- Revision:
- 8:c3153fd4d8ce
- Parent:
- 3:aa82968b7a8e
- Child:
- 15:807eba7c7811
Neaten code and implemented heath pack to the game.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| ll16o2l | 2:888634fff8ff | 1 | #ifndef PLAYER_H |
| ll16o2l | 2:888634fff8ff | 2 | #define PLAYER_H |
| ll16o2l | 2:888634fff8ff | 3 | |
| ll16o2l | 2:888634fff8ff | 4 | #include "mbed.h" |
| ll16o2l | 2:888634fff8ff | 5 | #include "N5110.h" |
| ll16o2l | 2:888634fff8ff | 6 | #include "Gamepad.h" |
| ll16o2l | 8:c3153fd4d8ce | 7 | |
| ll16o2l | 8:c3153fd4d8ce | 8 | /** Player Class |
| ll16o2l | 3:aa82968b7a8e | 9 | * @author Oliver Luong, University of Leeds |
| ll16o2l | 3:aa82968b7a8e | 10 | * @brief Controls the player in the Dodge game |
| ll16o2l | 3:aa82968b7a8e | 11 | * @date April 2019 |
| ll16o2l | 3:aa82968b7a8e | 12 | */ |
| ll16o2l | 2:888634fff8ff | 13 | |
| ll16o2l | 2:888634fff8ff | 14 | class Player |
| ll16o2l | 2:888634fff8ff | 15 | { |
| ll16o2l | 2:888634fff8ff | 16 | public: |
| ll16o2l | 2:888634fff8ff | 17 | |
| ll16o2l | 2:888634fff8ff | 18 | Player(); |
| ll16o2l | 2:888634fff8ff | 19 | ~Player(); |
| ll16o2l | 2:888634fff8ff | 20 | void init(int player_height,int player_width); |
| ll16o2l | 2:888634fff8ff | 21 | void draw(N5110 &lcd); |
| ll16o2l | 3:aa82968b7a8e | 22 | void update(Direction d, float mag); |
| ll16o2l | 2:888634fff8ff | 23 | Vector2D get_pos(); |
| ll16o2l | 2:888634fff8ff | 24 | |
| ll16o2l | 2:888634fff8ff | 25 | private: |
| ll16o2l | 2:888634fff8ff | 26 | |
| ll16o2l | 2:888634fff8ff | 27 | int _player_height; |
| ll16o2l | 2:888634fff8ff | 28 | int _player_width; |
| ll16o2l | 2:888634fff8ff | 29 | int _x; |
| ll16o2l | 2:888634fff8ff | 30 | int _y; |
| ll16o2l | 2:888634fff8ff | 31 | int _speed; |
| ll16o2l | 2:888634fff8ff | 32 | |
| ll16o2l | 2:888634fff8ff | 33 | }; |
| ll16o2l | 2:888634fff8ff | 34 | #endif |