1111111112

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers CXK.h Source File

CXK.h

00001 #ifndef CXK_H
00002 #define CXK_H
00003 
00004 #include "mbed.h"
00005 #include "N5110.h"
00006 #include "Gamepad.h"
00007 
00008 
00009 /** CXK Class
00010 * @brief defined the cxk and the add score funvtion
00011 * @author Zhang Xinyu
00012 * @school EE of  SWJTU &leeds joint school
00013 * @date  MAY  2019
00014 */ 
00015 
00016 class CXK
00017 {
00018 public:
00019 /** Constructor */
00020     CXK();
00021     
00022     /** Destrctor */
00023     ~CXK();
00024     
00025       /** Set the CXKinit  
00026        * @ param value that updated (x,y,height, width)
00027        * @ details the (x,y) mean the centre point figure of cxk ,height meansheight of CXK
00028     */
00029     void init(int x,int y,int height,int width);
00030     
00031     
00032       /** Set the CXKdraw  
00033        * @ param value that updated _x is x, _y is y (_x,_y)
00034        */
00035     void draw(N5110 &lcd);
00036     
00037      /** Set the CXKupdate  
00038        * @ param  drection of movement (direction)
00039        * @ vara means magenitude of the jiysticks 
00040        * @ details  North is decrement as origin is at the top-left so decreasing moves up 
00041     */
00042     void update(Direction d,float vara);
00043     
00044     /** Set the CXKscore
00045        * @ param  the score of the game palyer (score)
00046        * @ details add the score when meet the order of the code
00047     */
00048     void add_score();
00049     
00050     /** Set the CXKscore
00051        * @ returns the score (score)
00052        * @ details score = 0
00053        */
00054     int get_score();
00055     
00056     
00057     Vector2D get_pos();
00058 
00059 private:
00060 
00061     int _height;
00062     int _width;
00063     int _x;
00064     int _y;
00065     int _speed;
00066     int _score;
00067 
00068 };
00069 #endif