ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el18jgb

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Aim.h Source File

Aim.h

00001 #ifndef AIM_H
00002 #define AIM_H
00003 
00004 #include "mbed.h"
00005 #include "N5110.h"
00006 #include "Gamepad.h"
00007 #include "Heston.h"
00008 #include "FXOS8700CQ.h"
00009 
00010 /** Aim class
00011  * @brief cursor sprite
00012  * @author Joe Body, University of Leeds
00013  * @date May 2020
00014  */   
00015 
00016 class Aim
00017 {
00018 
00019 public:
00020 
00021     /** Constructor */
00022     Aim();
00023     
00024     /** Destructor */
00025     ~Aim();
00026     
00027     /** Initalises Aim*/
00028     void init();
00029     
00030     /** Draws the spike baste on state
00031     * @param lcd @details N5110 object
00032     * @param int state
00033     */
00034     void draw(N5110 &lcd, int state);
00035     
00036     /** update the position of the sprite using the joystick
00037     * @param pad @details Gamepad object
00038     */
00039     void update(Gamepad &pad);
00040     
00041     /** gets co-ordinates of the sprite
00042     * @ return position vector  
00043     */
00044     Vector2D get_pos();
00045     
00046     /** set co ordinates of sprite 
00047     * @param int x 
00048     * @param int y 
00049     */
00050     void set_pos(int x, int y);
00051     
00052     /** update the position of the sprite using the accelerometer
00053     * @param acc @details Accelerometer object
00054     */
00055     void acc_control(FXOS8700CQ &acc);
00056     
00057 private:
00058 
00059     /**vertical size sprite
00060     * @return _height
00061     */
00062     int _height;
00063     
00064     /**horizontal size sprite
00065     * @return _height
00066     */
00067     int _width;
00068     
00069     /** x position of sprite
00070     * @return _x
00071     */
00072     int _x;
00073     
00074     /** y position of sprite
00075     * @return _y
00076     */
00077     int _y;
00078     
00079     
00080     /** speed of sprite
00081     * @return _speed
00082     */
00083     int _speed;
00084     
00085     /** magnitude from joystick */
00086     float mag;
00087 
00088 
00089 };
00090 #endif