zhenye yang / Mbed 2 deprecated el17zy

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Rooney.h Source File

Rooney.h

00001 #ifndef ROONEY_H
00002 #define ROONEY_H
00003 
00004 #include "mbed.h"
00005 #include "N5110.h"
00006 #include "Gamepad.h"
00007 enum rooneybody{left, right, stand};
00008 class player
00009 {
00010 public:
00011  // Constructor and destructor.
00012   /**
00013   * @brief Constructor @details Non user specified.
00014   */
00015 player();
00016   /**
00017   * @brief Destructor @details Non user specified.
00018   */
00019 ~player();
00020   /**
00021   * @brief Initialises the Rooney.
00022   */
00023 void init();
00024   /**
00025   * @brief set the rooney position.
00026   */
00027 void set_palyer_x(float joy_x, int speed);
00028   /**
00029   * @brief get the collision flag.
00030   * @param &gamepad @details The gamepad object from Gamepad class.
00031   */
00032 bool collision_flag();
00033   /**
00034   * @brief set the rooney body form.
00035   */
00036 int * get_form(rooneybody body);
00037   /**
00038   * @brief set the rooney body y.
00039   */
00040 int get_y();
00041   /**
00042   * @brief set the rooney body x.
00043   */
00044 int get_x();
00045   /**
00046   * @brief set the rooney speed
00047   */
00048 int get_speed();
00049   /**
00050   * @brief add the score.
00051   */
00052 void add_score();
00053   /**
00054   * @brief get the score.
00055   */
00056 int get_score();
00057   /**
00058   * @draw form.
00059   */
00060 int drawrooney(N5110 &lcd);
00061 
00062 private:
00063 
00064 int _player_x;
00065 int _player_y;
00066 bool _collision_flag;
00067 int _speed;
00068 int _x;
00069 int _y;
00070 int _score;
00071 rooneybody body;
00072 };
00073 #endif