Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed Gamepad N5110 mbed-rtos
Background/Background.h@9:c5a19e358c07, 2019-05-09 (annotated)
- Committer:
- RexRoshan
- Date:
- Thu May 09 12:23:00 2019 +0000
- Revision:
- 9:c5a19e358c07
- Parent:
- 7:574c66ebd8b0
- Child:
- 10:f44b43ed1a06
-
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
RexRoshan | 7:574c66ebd8b0 | 1 | #ifndef BACKGROUND_H |
RexRoshan | 7:574c66ebd8b0 | 2 | #define BACKGROUND_H |
RexRoshan | 7:574c66ebd8b0 | 3 | |
RexRoshan | 7:574c66ebd8b0 | 4 | #include "mbed.h" |
RexRoshan | 7:574c66ebd8b0 | 5 | #include "N5110.h" |
RexRoshan | 7:574c66ebd8b0 | 6 | #include "Gamepad.h" |
RexRoshan | 7:574c66ebd8b0 | 7 | |
RexRoshan | 7:574c66ebd8b0 | 8 | /** Background Class |
RexRoshan | 7:574c66ebd8b0 | 9 | * @brief Shows the background of the minigame |
RexRoshan | 7:574c66ebd8b0 | 10 | * @author Rex Roshan Raj |
RexRoshan | 7:574c66ebd8b0 | 11 | */ |
RexRoshan | 9:c5a19e358c07 | 12 | |
RexRoshan | 7:574c66ebd8b0 | 13 | class Background |
RexRoshan | 7:574c66ebd8b0 | 14 | { |
RexRoshan | 7:574c66ebd8b0 | 15 | |
RexRoshan | 7:574c66ebd8b0 | 16 | public: |
RexRoshan | 7:574c66ebd8b0 | 17 | /** Constructor */ |
RexRoshan | 7:574c66ebd8b0 | 18 | Background(); |
RexRoshan | 7:574c66ebd8b0 | 19 | |
RexRoshan | 7:574c66ebd8b0 | 20 | /** Destructor */ |
RexRoshan | 7:574c66ebd8b0 | 21 | ~Background(); |
RexRoshan | 7:574c66ebd8b0 | 22 | |
RexRoshan | 7:574c66ebd8b0 | 23 | /** Initialise the parameters for background in minigame |
RexRoshan | 7:574c66ebd8b0 | 24 | *@param a - x position of the upper cloud |
RexRoshan | 7:574c66ebd8b0 | 25 | *@param b - y position of the upper cloud |
RexRoshan | 7:574c66ebd8b0 | 26 | */ |
RexRoshan | 7:574c66ebd8b0 | 27 | void init_u(int a,int b); |
RexRoshan | 7:574c66ebd8b0 | 28 | |
RexRoshan | 7:574c66ebd8b0 | 29 | /** Initialise the parameters for background in minigame |
RexRoshan | 7:574c66ebd8b0 | 30 | *@param c - x position of the lower cloud |
RexRoshan | 7:574c66ebd8b0 | 31 | *@param d - y position of the lower cloud |
RexRoshan | 7:574c66ebd8b0 | 32 | */ |
RexRoshan | 7:574c66ebd8b0 | 33 | void init_l(int c, int d); |
RexRoshan | 7:574c66ebd8b0 | 34 | |
RexRoshan | 7:574c66ebd8b0 | 35 | /** Draws the enemy |
RexRoshan | 7:574c66ebd8b0 | 36 | * @param N5110 lcd |
RexRoshan | 7:574c66ebd8b0 | 37 | * @brief Draws the enemy in stage one |
RexRoshan | 7:574c66ebd8b0 | 38 | */ |
RexRoshan | 7:574c66ebd8b0 | 39 | void background(N5110 &lcd); |
RexRoshan | 7:574c66ebd8b0 | 40 | |
RexRoshan | 7:574c66ebd8b0 | 41 | /** Updates the movement |
RexRoshan | 7:574c66ebd8b0 | 42 | * @brief Changes the y position for animation once the enemy has died |
RexRoshan | 7:574c66ebd8b0 | 43 | */ |
RexRoshan | 7:574c66ebd8b0 | 44 | void update(); |
RexRoshan | 7:574c66ebd8b0 | 45 | |
RexRoshan | 7:574c66ebd8b0 | 46 | /** Gets the position of the upper cloud |
RexRoshan | 7:574c66ebd8b0 | 47 | * @returns a struct with x,y members which corresponds to x and y position respectively |
RexRoshan | 7:574c66ebd8b0 | 48 | */ |
RexRoshan | 7:574c66ebd8b0 | 49 | Vector2D get_pos_upper(); |
RexRoshan | 7:574c66ebd8b0 | 50 | |
RexRoshan | 7:574c66ebd8b0 | 51 | /** Gets the position of the lower cloud |
RexRoshan | 7:574c66ebd8b0 | 52 | * @returns a struct with x,y members which corresponds to x and y position respectively |
RexRoshan | 7:574c66ebd8b0 | 53 | */ |
RexRoshan | 7:574c66ebd8b0 | 54 | Vector2D get_pos_lower(); |
RexRoshan | 7:574c66ebd8b0 | 55 | |
RexRoshan | 7:574c66ebd8b0 | 56 | /** Sets the position of the upper cloud |
RexRoshan | 7:574c66ebd8b0 | 57 | * @param position of the upper cloud |
RexRoshan | 7:574c66ebd8b0 | 58 | */ |
RexRoshan | 7:574c66ebd8b0 | 59 | void set_pos_upper(Vector2D e); |
RexRoshan | 7:574c66ebd8b0 | 60 | |
RexRoshan | 7:574c66ebd8b0 | 61 | /** Sets the position of the lower cloud |
RexRoshan | 7:574c66ebd8b0 | 62 | * @param position of the lower cloud |
RexRoshan | 7:574c66ebd8b0 | 63 | */ |
RexRoshan | 7:574c66ebd8b0 | 64 | void set_pos_lower(Vector2D e); |
RexRoshan | 7:574c66ebd8b0 | 65 | |
RexRoshan | 7:574c66ebd8b0 | 66 | private: |
RexRoshan | 7:574c66ebd8b0 | 67 | |
RexRoshan | 7:574c66ebd8b0 | 68 | // methods |
RexRoshan | 7:574c66ebd8b0 | 69 | int _a; |
RexRoshan | 7:574c66ebd8b0 | 70 | int _b; |
RexRoshan | 7:574c66ebd8b0 | 71 | int _c; |
RexRoshan | 7:574c66ebd8b0 | 72 | int _d; |
RexRoshan | 7:574c66ebd8b0 | 73 | int _fast; |
RexRoshan | 7:574c66ebd8b0 | 74 | |
RexRoshan | 7:574c66ebd8b0 | 75 | }; |
RexRoshan | 7:574c66ebd8b0 | 76 | |
RexRoshan | 7:574c66ebd8b0 | 77 | #endif |