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.
People.h
00001 #ifndef PEOPLE_H 00002 #define PEOPLE_H 00003 00004 // Included Headers ------------------------------------------------------------ 00005 #include "mbed.h" 00006 #include "RandomMovement.h" 00007 #include "CheckAlienCollision.h" 00008 00009 /** People class 00010 * @brief Draws people and moves them if collected by aliens 00011 * @author Benjamin Evans, University of Leeds 00012 * @date May 2020 00013 */ 00014 class People: public RandomMovement, public CheckAlienCollision { 00015 public: 00016 /** Constructor */ 00017 People(); 00018 00019 /** Destructor */ 00020 ~People(); 00021 00022 /** Initalises Alien 00023 * @param position_x_start @details Random x start pos of people 00024 * @param pad @detials Gamepad object 00025 */ 00026 void init(Gamepad &pad, int position_x_start); 00027 00028 /** Draws the people 00029 * @param lcd @details N5110 object 00030 * @param d_ @details joystick direction 00031 * @param map_length @details length of the map 00032 * @param position_x_map_ @details x posisition that map starts 00033 */ 00034 void draw_people(N5110 &lcd, Direction d_, int map_length_, 00035 int position_x_map_); 00036 00037 // Accessors and mutators -------------------------------------------------- 00038 00039 /** Gets alien collision flag 00040 * @return alien_collision_flag 00041 */ 00042 bool get_alien_collision_flag(); 00043 00044 private: 00045 // Function prototypes ----------------------------------------------------- 00046 00047 /** Stops the people from moving off the edge of the map and moves 00048 * people if the map loops 00049 * @param map_length_@details : length of the map 00050 * @param position_x_map_ @detials : the drawing start posisiton of the 00051 * map 00052 */ 00053 void off_screen_x_y_checker(int map_length_, int position_x_map_); 00054 00055 /** Move alien to top of screen if collision with alien */ 00056 void collision_with_alien(); 00057 00058 // Variables --------------------------------------------------------------- 00059 00060 /** People movement counter */ 00061 int people_move_counter_; 00062 00063 }; 00064 00065 #endif
Generated on Fri Aug 5 2022 06:55:07 by
1.7.2