ELEC2645 (2018/19) / Mbed 2 deprecated el17rrrs

Dependencies:   mbed Gamepad N5110 mbed-rtos

Committer:
RexRoshan
Date:
Thu May 09 09:49:35 2019 +0000
Revision:
0:d9cf94b41df3
Documentation has been completed and the code has been slightly modified

Who changed what in which revision?

UserRevisionLine numberNew contents of line
RexRoshan 0:d9cf94b41df3 1 #ifndef BACKGROUND_H
RexRoshan 0:d9cf94b41df3 2 #define BACKGROUND_H
RexRoshan 0:d9cf94b41df3 3
RexRoshan 0:d9cf94b41df3 4 #include "mbed.h"
RexRoshan 0:d9cf94b41df3 5 #include "N5110.h"
RexRoshan 0:d9cf94b41df3 6 #include "Gamepad.h"
RexRoshan 0:d9cf94b41df3 7
RexRoshan 0:d9cf94b41df3 8 /** Background Class
RexRoshan 0:d9cf94b41df3 9 * @brief Shows the background of the minigame
RexRoshan 0:d9cf94b41df3 10 * @author Rex Roshan Raj
RexRoshan 0:d9cf94b41df3 11 */
RexRoshan 0:d9cf94b41df3 12 class Background
RexRoshan 0:d9cf94b41df3 13 {
RexRoshan 0:d9cf94b41df3 14
RexRoshan 0:d9cf94b41df3 15 public:
RexRoshan 0:d9cf94b41df3 16 /** Constructor */
RexRoshan 0:d9cf94b41df3 17 Background();
RexRoshan 0:d9cf94b41df3 18
RexRoshan 0:d9cf94b41df3 19 /** Destructor */
RexRoshan 0:d9cf94b41df3 20 ~Background();
RexRoshan 0:d9cf94b41df3 21
RexRoshan 0:d9cf94b41df3 22 /** Initialise the parameters for background in minigame
RexRoshan 0:d9cf94b41df3 23 *@param a - x position of the upper cloud
RexRoshan 0:d9cf94b41df3 24 *@param b - y position of the upper cloud
RexRoshan 0:d9cf94b41df3 25 */
RexRoshan 0:d9cf94b41df3 26 void init_u(int a,int b);
RexRoshan 0:d9cf94b41df3 27
RexRoshan 0:d9cf94b41df3 28 /** Initialise the parameters for background in minigame
RexRoshan 0:d9cf94b41df3 29 *@param c - x position of the lower cloud
RexRoshan 0:d9cf94b41df3 30 *@param d - y position of the lower cloud
RexRoshan 0:d9cf94b41df3 31 */
RexRoshan 0:d9cf94b41df3 32 void init_l(int c, int d);
RexRoshan 0:d9cf94b41df3 33
RexRoshan 0:d9cf94b41df3 34 /** Draws the enemy
RexRoshan 0:d9cf94b41df3 35 * @param N5110 lcd
RexRoshan 0:d9cf94b41df3 36 * @brief Draws the enemy in stage one
RexRoshan 0:d9cf94b41df3 37 */
RexRoshan 0:d9cf94b41df3 38 void background(N5110 &lcd);
RexRoshan 0:d9cf94b41df3 39
RexRoshan 0:d9cf94b41df3 40 /** Updates the movement
RexRoshan 0:d9cf94b41df3 41 * @brief Changes the y position for animation once the enemy has died
RexRoshan 0:d9cf94b41df3 42 */
RexRoshan 0:d9cf94b41df3 43 void update();
RexRoshan 0:d9cf94b41df3 44
RexRoshan 0:d9cf94b41df3 45 /** Gets the position of the upper cloud
RexRoshan 0:d9cf94b41df3 46 * @returns a struct with x,y members which corresponds to x and y position respectively
RexRoshan 0:d9cf94b41df3 47 */
RexRoshan 0:d9cf94b41df3 48 Vector2D get_pos_upper();
RexRoshan 0:d9cf94b41df3 49
RexRoshan 0:d9cf94b41df3 50 /** Gets the position of the lower cloud
RexRoshan 0:d9cf94b41df3 51 * @returns a struct with x,y members which corresponds to x and y position respectively
RexRoshan 0:d9cf94b41df3 52 */
RexRoshan 0:d9cf94b41df3 53 Vector2D get_pos_lower();
RexRoshan 0:d9cf94b41df3 54
RexRoshan 0:d9cf94b41df3 55 /** Sets the position of the upper cloud
RexRoshan 0:d9cf94b41df3 56 * @param position of the upper cloud
RexRoshan 0:d9cf94b41df3 57 */
RexRoshan 0:d9cf94b41df3 58 void set_pos_upper(Vector2D e);
RexRoshan 0:d9cf94b41df3 59
RexRoshan 0:d9cf94b41df3 60 /** Sets the position of the lower cloud
RexRoshan 0:d9cf94b41df3 61 * @param position of the lower cloud
RexRoshan 0:d9cf94b41df3 62 */
RexRoshan 0:d9cf94b41df3 63 void set_pos_lower(Vector2D e);
RexRoshan 0:d9cf94b41df3 64
RexRoshan 0:d9cf94b41df3 65 private:
RexRoshan 0:d9cf94b41df3 66
RexRoshan 0:d9cf94b41df3 67 // methods
RexRoshan 0:d9cf94b41df3 68 int _a;
RexRoshan 0:d9cf94b41df3 69 int _b;
RexRoshan 0:d9cf94b41df3 70 int _c;
RexRoshan 0:d9cf94b41df3 71 int _d;
RexRoshan 0:d9cf94b41df3 72 int _fast;
RexRoshan 0:d9cf94b41df3 73
RexRoshan 0:d9cf94b41df3 74 };
RexRoshan 0:d9cf94b41df3 75
RexRoshan 0:d9cf94b41df3 76 #endif