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_two/YouTube_files/YouTube.h
- Committer:
- yfkwok
- Date:
- 2019-05-09
- Revision:
- 34:3ddfaa217eca
- Parent:
- 19:903d67bb0dea
File content as of revision 34:3ddfaa217eca:
#ifndef YOUTUBE_H #define YOUTUBE_H #include "mbed.h" #include "N5110.h" #include "Gamepad.h" /** YouTube Class @author Yiu Fai Kwok, University of Leeds @brief Controls the YouTube in Game_2 @date 18/04/2019 */ class YouTube { public: /** Constructor */ YouTube(); /** Deconstructor */ ~YouTube(); /** * @brief Initialize the class parameters * @param speed (int) * @details Initialize the object's position and speed by randomizing a number between 0-7. */ void init(int speed); /** * @brief Draw the object * @details Draw the object according the position _x and _y. */ void draw(N5110 &lcd); /** * @brief Update the object * @details Update the new position of the object determined by the speed parameter and initial position */ void update(); // accessors and mutators /** * @brief Set the object's velocity * @param velocity v (Vector2D) * @details Set the velocity of the object according to the initial set up from the init(int speed) function */ void set_velocity(Vector2D v); /** * @brief Get the object's velocity * @return the current velocity (Vector2D) * @details Get the velocity of the object and return as Vector2D */ Vector2D get_velocity(); /** * @brief Get the object's position * @return the current position (Vector2D) * @details Get the position x and y of the object and return as Vector2D */ Vector2D get_pos(); /** * @brief Set the object's position * @param the value of position p (Vector2D) * @details Set the position x and y of the object according to the input p */ void set_pos(Vector2D p); private: Vector2D _velocity; int _x; int _y; }; #endif