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
Charactersprites.h
00001 #ifndef CHARACTERSPRITES_H 00002 #define CHARACTERSPRITES_H 00003 00004 #include "mbed.h" 00005 #include "N5110.h" 00006 #include "Gamepad.h" 00007 00008 00009 /** Charactersprites Class 00010 @author Mr Nigel TK Vere, University of Leeds 00011 @brief Controls and models the fruit characters used in the game main character for the badman game 00012 @date April 2019 00013 */ 00014 00015 /** Charactersprites Class 00016 00017 @brief Controls and models the fruit characters used in the game main character for the badman game 00018 00019 @version 1.0 00020 00021 @author Mr Nigel TK Vere 00022 00023 @date April 2019 00024 00025 00026 */ 00027 class Charactersprites 00028 { 00029 00030 public: 00031 /** 00032 * @brief Default Charactersprite object constructor 00033 00034 */ 00035 Charactersprites(); 00036 /** 00037 * @brief Default Charactersprite object destructor 00038 00039 */ 00040 ~Charactersprites(); 00041 00042 /** 00043 * @brief Mutator method displays the charactersprite object on the lcd screen dependent on it's current x and y coordinates and the respective object type 00044 * @param lcd @details Refrence NOKIA 5110 LCD screen object 00045 */ 00046 void displaySprite(N5110 &lcd); 00047 /** 00048 * @brief Mutator method initialises the charactersprite object setting it's top left corner x and y coordinates and the type of object to be drawn 00049 * @param x @details Integer value representing the value of the x coordinate of the top left corner of the charactersprite object on the screen 00050 * @param y @details Integer value representing the value of the y coordinate of the top left corner of the charactersprite object on the screen 00051 * @param num @details Integer value representing the specific charactersprite object to be initialised and drawn subsequently on the screen 00052 */ 00053 void init(int x,int y,int num); 00054 /** 00055 * @brief Accessor method gets the type value of the charactersrpite object 00056 @returns Returns the type(_value private variable ) of the charactersprite object 00057 00058 */ 00059 int getValue(); 00060 /** 00061 * @brief Accessor method gets the coordinates of the top right corner of charactersrpite object 00062 @returns Returns the top right hand coordinates(_topr private variable ) of the charactersprite object as a Vector2D object 00063 00064 */ 00065 Vector2D getTopr(); 00066 /** 00067 * @brief Accessor method gets the coordinates of the bottom right corner of charactersrpite object 00068 @returns Returns the bottom right hand corner coordinates(_bottr private variable ) of the charactersprite object as a Vector2D object 00069 00070 */ 00071 Vector2D getBottr(); 00072 /** 00073 * @brief Accessor method gets the coordinates of the bottom left corner of charactersrpite object 00074 @returns Returns the bottom left hand coordinates(_bottl private variable ) of the charactersprite object as a Vector2D object 00075 00076 */ 00077 Vector2D getBottl(); 00078 /** 00079 * @brief Accessor method gets the coordinates of the top left corner of charactersrpite object 00080 @returns Returns the top left hand corner coordinates(_topl private variable ) of the charactersprite object as a Vector2D object 00081 00082 */ 00083 Vector2D getTopl(); 00084 00085 00086 00087 00088 00089 00090 00091 private: 00092 int _rows;//Integer variable holds the number of rows present in the respective charactersprite object 00093 int _cols;//Integer variable holds the number of columns present in the respective charactersprite object 00094 int _type;//Integer variable holds the type of charactersprite object 00095 int _value;//Integer variable holds the numeric score value of the respective chractersprite 00096 Vector2D _topr;//Vector variable holds the coordinates of the top right hand corner of the charactersprite object 00097 Vector2D _bottr;//Vector variable holds the coordinates of the bottom right hand corner of the charactersprite object 00098 Vector2D _bottl;//Vector variable holds the coordinates of the bottom left hand corner of the charactersprite object 00099 Vector2D _topl;//Vector variable holds the coordinates of the top left hand corner of the charactersprite object 00100 00101 00102 }; 00103 #endif
Generated on Thu Aug 4 2022 12:05:20 by
1.7.2