![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Game codes for Pokemon Academy Yiu Fai Kwok - 201198802 I have read the University Regulations on Plagiarism and state that the work covered by this declaration is my own and does not contain any unacknowledged work from other sources.
Dependencies: mbed FXOS8700CQ mbed-rtos
Game_three/Book/Book.h@34:3ddfaa217eca, 2019-05-09 (annotated)
- Committer:
- yfkwok
- Date:
- Thu May 09 00:41:05 2019 +0000
- Revision:
- 34:3ddfaa217eca
- Parent:
- 21:704d938acf5d
09/05/2019 - Last commit before submission
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yfkwok | 21:704d938acf5d | 1 | #ifndef BOOK_H |
yfkwok | 21:704d938acf5d | 2 | #define BOOK_H |
yfkwok | 21:704d938acf5d | 3 | |
yfkwok | 21:704d938acf5d | 4 | #include "mbed.h" |
yfkwok | 21:704d938acf5d | 5 | #include "N5110.h" |
yfkwok | 21:704d938acf5d | 6 | #include "Gamepad.h" |
yfkwok | 21:704d938acf5d | 7 | |
yfkwok | 21:704d938acf5d | 8 | /** Book Class |
yfkwok | 21:704d938acf5d | 9 | * @author Yiu Fai Kwok, University of Leeds |
yfkwok | 21:704d938acf5d | 10 | * @brief Define the properties of the object book in Game_3 |
yfkwok | 21:704d938acf5d | 11 | * @date 23/04/2019 |
yfkwok | 21:704d938acf5d | 12 | */ |
yfkwok | 21:704d938acf5d | 13 | |
yfkwok | 21:704d938acf5d | 14 | class Book |
yfkwok | 21:704d938acf5d | 15 | { |
yfkwok | 21:704d938acf5d | 16 | |
yfkwok | 21:704d938acf5d | 17 | public: |
yfkwok | 21:704d938acf5d | 18 | |
yfkwok | 21:704d938acf5d | 19 | /** Constructor */ |
yfkwok | 21:704d938acf5d | 20 | Book(); |
yfkwok | 21:704d938acf5d | 21 | /** Deconstructor */ |
yfkwok | 21:704d938acf5d | 22 | ~Book(); |
yfkwok | 21:704d938acf5d | 23 | |
yfkwok | 21:704d938acf5d | 24 | /** |
yfkwok | 21:704d938acf5d | 25 | * @brief Initialize the class parameters |
yfkwok | 21:704d938acf5d | 26 | * @param the value for position (int) |
yfkwok | 21:704d938acf5d | 27 | * @details Initialize the Book's position |
yfkwok | 21:704d938acf5d | 28 | */ |
yfkwok | 21:704d938acf5d | 29 | void init(int position); |
yfkwok | 21:704d938acf5d | 30 | |
yfkwok | 21:704d938acf5d | 31 | /** |
yfkwok | 21:704d938acf5d | 32 | * @brief Draw the Book - block in Game 3 |
yfkwok | 21:704d938acf5d | 33 | * @details Draw the book on lcd screen |
yfkwok | 21:704d938acf5d | 34 | */ |
yfkwok | 21:704d938acf5d | 35 | void draw(N5110 &lcd); |
yfkwok | 21:704d938acf5d | 36 | |
yfkwok | 21:704d938acf5d | 37 | /** |
yfkwok | 21:704d938acf5d | 38 | * @brief Get the position |
yfkwok | 21:704d938acf5d | 39 | * @return the current position (Vector2D) |
yfkwok | 21:704d938acf5d | 40 | * @details Return the position of the book |
yfkwok | 21:704d938acf5d | 41 | */ |
yfkwok | 21:704d938acf5d | 42 | Vector2D get_pos(); |
yfkwok | 21:704d938acf5d | 43 | |
yfkwok | 21:704d938acf5d | 44 | /** |
yfkwok | 21:704d938acf5d | 45 | * @brief Set the position |
yfkwok | 21:704d938acf5d | 46 | * @param position p (Vector2D) |
yfkwok | 21:704d938acf5d | 47 | * @details Set the position of the book |
yfkwok | 21:704d938acf5d | 48 | */ |
yfkwok | 21:704d938acf5d | 49 | void set_pos(Vector2D p); |
yfkwok | 21:704d938acf5d | 50 | |
yfkwok | 21:704d938acf5d | 51 | private: |
yfkwok | 21:704d938acf5d | 52 | |
yfkwok | 21:704d938acf5d | 53 | int _x; |
yfkwok | 21:704d938acf5d | 54 | int _y; |
yfkwok | 21:704d938acf5d | 55 | |
yfkwok | 21:704d938acf5d | 56 | }; |
yfkwok | 21:704d938acf5d | 57 | #endif |