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

Committer:
yfkwok
Date:
Thu May 09 00:41:05 2019 +0000
Revision:
34:3ddfaa217eca
Parent:
19:903d67bb0dea
09/05/2019 - Last commit before submission

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yfkwok 14:abe64fe0b6a5 1 #ifndef TWITTER_H
yfkwok 14:abe64fe0b6a5 2 #define TWITTER_H
yfkwok 14:abe64fe0b6a5 3
yfkwok 14:abe64fe0b6a5 4 #include "mbed.h"
yfkwok 14:abe64fe0b6a5 5 #include "N5110.h"
yfkwok 14:abe64fe0b6a5 6 #include "Gamepad.h"
yfkwok 14:abe64fe0b6a5 7
yfkwok 14:abe64fe0b6a5 8 /** Twitter Class
yfkwok 14:abe64fe0b6a5 9 @author Yiu Fai Kwok, University of Leeds
yfkwok 14:abe64fe0b6a5 10 @brief Controls the Twitter in Game_2
yfkwok 14:abe64fe0b6a5 11 @date 18/04/2019
yfkwok 14:abe64fe0b6a5 12 */
yfkwok 14:abe64fe0b6a5 13 class Twitter
yfkwok 14:abe64fe0b6a5 14 {
yfkwok 14:abe64fe0b6a5 15
yfkwok 14:abe64fe0b6a5 16 public:
yfkwok 19:903d67bb0dea 17
yfkwok 19:903d67bb0dea 18
yfkwok 19:903d67bb0dea 19 /** Constructor */
yfkwok 14:abe64fe0b6a5 20 Twitter();
yfkwok 19:903d67bb0dea 21 /** Deconstructor */
yfkwok 14:abe64fe0b6a5 22 ~Twitter();
yfkwok 19:903d67bb0dea 23
yfkwok 19:903d67bb0dea 24 /**
yfkwok 19:903d67bb0dea 25 * @brief Initialize the class parameters
yfkwok 19:903d67bb0dea 26 * @param speed (int)
yfkwok 19:903d67bb0dea 27 * @details Initialize the object's position and speed by randomizing a number between 0-7.
yfkwok 19:903d67bb0dea 28 */
yfkwok 14:abe64fe0b6a5 29 void init(int speed);
yfkwok 19:903d67bb0dea 30
yfkwok 19:903d67bb0dea 31 /**
yfkwok 19:903d67bb0dea 32 * @brief Draw the object
yfkwok 19:903d67bb0dea 33 * @details Draw the object according the position _x and _y.
yfkwok 19:903d67bb0dea 34 */
yfkwok 14:abe64fe0b6a5 35 void draw(N5110 &lcd);
yfkwok 19:903d67bb0dea 36
yfkwok 19:903d67bb0dea 37 /**
yfkwok 19:903d67bb0dea 38 * @brief Update the object
yfkwok 19:903d67bb0dea 39 * @details Update the new position of the object determined by the speed parameter and initial position
yfkwok 19:903d67bb0dea 40 */
yfkwok 14:abe64fe0b6a5 41 void update();
yfkwok 19:903d67bb0dea 42
yfkwok 19:903d67bb0dea 43 // accessors and mutators
yfkwok 19:903d67bb0dea 44 /**
yfkwok 19:903d67bb0dea 45 * @brief Set the object's velocity
yfkwok 19:903d67bb0dea 46 * @param velocity v (Vector2D)
yfkwok 19:903d67bb0dea 47 * @details Set the velocity of the object according to the initial set up from the init(int speed) function
yfkwok 19:903d67bb0dea 48 */
yfkwok 14:abe64fe0b6a5 49 void set_velocity(Vector2D v);
yfkwok 19:903d67bb0dea 50
yfkwok 19:903d67bb0dea 51 /**
yfkwok 19:903d67bb0dea 52 * @brief Get the object's velocity
yfkwok 19:903d67bb0dea 53 * @return the current velocity (Vector2D)
yfkwok 19:903d67bb0dea 54 * @details Get the velocity of the object and return as Vector2D
yfkwok 19:903d67bb0dea 55 */
yfkwok 14:abe64fe0b6a5 56 Vector2D get_velocity();
yfkwok 19:903d67bb0dea 57
yfkwok 19:903d67bb0dea 58 /**
yfkwok 19:903d67bb0dea 59 * @brief Get the object's position
yfkwok 19:903d67bb0dea 60 * @return the current position (Vector2D)
yfkwok 19:903d67bb0dea 61 * @details Get the position x and y of the object and return as Vector2D
yfkwok 19:903d67bb0dea 62 */
yfkwok 14:abe64fe0b6a5 63 Vector2D get_pos();
yfkwok 19:903d67bb0dea 64
yfkwok 19:903d67bb0dea 65 /**
yfkwok 19:903d67bb0dea 66 * @brief Set the object's position
yfkwok 19:903d67bb0dea 67 * @param the value of position p (Vector2D)
yfkwok 19:903d67bb0dea 68 * @details Set the position x and y of the object according to the input p
yfkwok 19:903d67bb0dea 69 */
yfkwok 14:abe64fe0b6a5 70 void set_pos(Vector2D p);
yfkwok 14:abe64fe0b6a5 71
yfkwok 14:abe64fe0b6a5 72 private:
yfkwok 14:abe64fe0b6a5 73 Vector2D _velocity;
yfkwok 14:abe64fe0b6a5 74 int _x;
yfkwok 14:abe64fe0b6a5 75 int _y;
yfkwok 14:abe64fe0b6a5 76 };
yfkwok 14:abe64fe0b6a5 77 #endif