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.
Monster.h
00001 #ifndef Monster_H 00002 #define Monster_H 00003 00004 #include "mbed.h" 00005 #include "N5110.h" 00006 #include "Gamepad.h" 00007 00008 /** Monster Class 00009 @brief Controls the monster in the gold miner game 00010 @author Yufan Zhong, University of Leeds and SWJTU 00011 @date May 2020 00012 */ 00013 00014 class Monster 00015 { 00016 public: 00017 /** Constructor */ 00018 Monster(); 00019 00020 /** Destructor */ 00021 ~Monster(); 00022 00023 /** Initialise the monster 00024 * @param speed - the speed of monster 00025 */ 00026 void init(float speed); 00027 00028 /** Draw the monster 00029 * @param lcd - N5110 library 00030 */ 00031 void draw(N5110 &lcd); 00032 00033 /** Update the data 00034 */ 00035 void update(); 00036 00037 /** Set the position of the monster 00038 * @param the position of the monster. 00039 */ 00040 void set_pos(int x); 00041 00042 /** Get the position of the monster 00043 * @return the position of the monster. 00044 */ 00045 int get_pos(); 00046 00047 /** Set the speed of the monster 00048 * @param speed - the speed of monster 00049 */ 00050 void set_speed(float speed); 00051 00052 /** Get the speed of monster 00053 * @return the speed of the monster 00054 */ 00055 float get_speed(); 00056 00057 private: 00058 00059 int _x; 00060 int _y; 00061 int _speed; 00062 }; 00063 #endif
Generated on Sat Jul 16 2022 10:18:04 by
1.7.2