demo

Dependencies:   mbed Gamepad N5110

Committer:
Ting12138
Date:
Thu May 14 12:57:32 2020 +0000
Revision:
0:ba32cfe0051e
demo

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Ting12138 0:ba32cfe0051e 1 #ifndef ROCKET_H
Ting12138 0:ba32cfe0051e 2 #define ROCKET_H
Ting12138 0:ba32cfe0051e 3
Ting12138 0:ba32cfe0051e 4 #include "mbed.h"
Ting12138 0:ba32cfe0051e 5 #include "N5110.h"
Ting12138 0:ba32cfe0051e 6 #include "Gamepad.h"
Ting12138 0:ba32cfe0051e 7 class rocket
Ting12138 0:ba32cfe0051e 8 {
Ting12138 0:ba32cfe0051e 9 public:
Ting12138 0:ba32cfe0051e 10
Ting12138 0:ba32cfe0051e 11 rocket();
Ting12138 0:ba32cfe0051e 12 ~rocket();
Ting12138 0:ba32cfe0051e 13
Ting12138 0:ba32cfe0051e 14 void init(int x);
Ting12138 0:ba32cfe0051e 15 /**
Ting12138 0:ba32cfe0051e 16 * @returns x posititon of rocket
Ting12138 0:ba32cfe0051e 17 * @brief Resets the position of rocket
Ting12138 0:ba32cfe0051e 18 */
Ting12138 0:ba32cfe0051e 19 void draw(N5110 &lcd);
Ting12138 0:ba32cfe0051e 20 // accessors and mutators
Ting12138 0:ba32cfe0051e 21 /**
Ting12138 0:ba32cfe0051e 22 * @returns The new coordinate of rocket
Ting12138 0:ba32cfe0051e 23 * @brief Updates the position of rocket
Ting12138 0:ba32cfe0051e 24 */
Ting12138 0:ba32cfe0051e 25 void lose_score();
Ting12138 0:ba32cfe0051e 26 // accessors and mutators
Ting12138 0:ba32cfe0051e 27 /**
Ting12138 0:ba32cfe0051e 28 * @returns The score of lossing
Ting12138 0:ba32cfe0051e 29 * @brief Updates the score of rocket
Ting12138 0:ba32cfe0051e 30 */
Ting12138 0:ba32cfe0051e 31 int get_final_score();
Ting12138 0:ba32cfe0051e 32 /**
Ting12138 0:ba32cfe0051e 33 * @returns The new coordinate of foods
Ting12138 0:ba32cfe0051e 34 * @brief Updates the position of foods
Ting12138 0:ba32cfe0051e 35 */
Ting12138 0:ba32cfe0051e 36 Vector2D get_pos();
Ting12138 0:ba32cfe0051e 37 void replace(Direction d,float mag,Vector2D mapped_coord);
Ting12138 0:ba32cfe0051e 38 void add_score();
Ting12138 0:ba32cfe0051e 39
Ting12138 0:ba32cfe0051e 40
Ting12138 0:ba32cfe0051e 41 private:
Ting12138 0:ba32cfe0051e 42 int _size;
Ting12138 0:ba32cfe0051e 43 int _x;
Ting12138 0:ba32cfe0051e 44 int _y;
Ting12138 0:ba32cfe0051e 45 int _scale;
Ting12138 0:ba32cfe0051e 46 int _score;
Ting12138 0:ba32cfe0051e 47 int _easter;
Ting12138 0:ba32cfe0051e 48
Ting12138 0:ba32cfe0051e 49 };
Ting12138 0:ba32cfe0051e 50 #endif