Player Library
Player.h@14:f2562b193023, 2017-05-04 (annotated)
- Committer:
- ll14c4p
- Date:
- Thu May 04 11:36:13 2017 +0000
- Revision:
- 14:f2562b193023
- Parent:
- 12:1324d72d12a6
+Deoxygen; +Changed Speed again
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ll14c4p | 0:a88279bdf8c0 | 1 | #ifndef PLAYER_H |
ll14c4p | 0:a88279bdf8c0 | 2 | #define PLAYER_H |
ll14c4p | 0:a88279bdf8c0 | 3 | |
ll14c4p | 0:a88279bdf8c0 | 4 | #include "mbed.h" |
ll14c4p | 0:a88279bdf8c0 | 5 | #include "N5110.h" |
ll14c4p | 0:a88279bdf8c0 | 6 | #include "Gamepad.h" |
ll14c4p | 0:a88279bdf8c0 | 7 | |
ll14c4p | 0:a88279bdf8c0 | 8 | |
ll14c4p | 0:a88279bdf8c0 | 9 | class Player |
ll14c4p | 0:a88279bdf8c0 | 10 | { |
ll14c4p | 0:a88279bdf8c0 | 11 | public: |
ll14c4p | 12:1324d72d12a6 | 12 | |
ll14c4p | 12:1324d72d12a6 | 13 | |
ll14c4p | 1:933b7aa73bbc | 14 | Player(); |
ll14c4p | 1:933b7aa73bbc | 15 | ~Player(); |
ll14c4p | 14:f2562b193023 | 16 | |
ll14c4p | 14:f2562b193023 | 17 | /** Initialise Player |
ll14c4p | 14:f2562b193023 | 18 | * |
ll14c4p | 14:f2562b193023 | 19 | * This function initalises the player library. |
ll14c4p | 14:f2562b193023 | 20 | */ |
ll14c4p | 7:6987a8d682a3 | 21 | void init(); |
ll14c4p | 14:f2562b193023 | 22 | |
ll14c4p | 14:f2562b193023 | 23 | /** Draw |
ll14c4p | 14:f2562b193023 | 24 | * |
ll14c4p | 14:f2562b193023 | 25 | * This function draws the Player sprite onto the screen at the specified coordinates. |
ll14c4p | 14:f2562b193023 | 26 | */ |
ll14c4p | 1:933b7aa73bbc | 27 | void draw(N5110 &lcd); |
ll14c4p | 14:f2562b193023 | 28 | |
ll14c4p | 14:f2562b193023 | 29 | /** Update |
ll14c4p | 14:f2562b193023 | 30 | * |
ll14c4p | 14:f2562b193023 | 31 | * This function updates the player sprite position on screen. |
ll14c4p | 14:f2562b193023 | 32 | */ |
ll14c4p | 1:933b7aa73bbc | 33 | void update(Direction d,float mag); |
ll14c4p | 14:f2562b193023 | 34 | |
ll14c4p | 14:f2562b193023 | 35 | /** Get Position |
ll14c4p | 14:f2562b193023 | 36 | * |
ll14c4p | 14:f2562b193023 | 37 | * This function obtains the coordinate of the top-left pixel in the player sprite. |
ll14c4p | 14:f2562b193023 | 38 | */ |
ll14c4p | 4:6d5ea29f83b0 | 39 | Vector2D get_pos(); |
ll14c4p | 10:43b537436eb5 | 40 | |
ll14c4p | 9:002ea306683d | 41 | |
ll14c4p | 0:a88279bdf8c0 | 42 | private: |
ll14c4p | 6:79a9c37a0b80 | 43 | int m; |
ll14c4p | 1:933b7aa73bbc | 44 | int _x; |
ll14c4p | 1:933b7aa73bbc | 45 | int _y; |
ll14c4p | 1:933b7aa73bbc | 46 | int _speed; |
ll14c4p | 1:933b7aa73bbc | 47 | |
ll14c4p | 0:a88279bdf8c0 | 48 | }; |
ll14c4p | 0:a88279bdf8c0 | 49 | #endif |