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 ELEC2645_Project_el17my
prey/Prey.h@2:5e54476c518f, 2020-05-26 (annotated)
- Committer:
- yumaowei
- Date:
- Tue May 26 07:24:21 2020 +0000
- Revision:
- 2:5e54476c518f
Final Submission. I have read and agreed with Statement of Academic Integrity.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| yumaowei | 2:5e54476c518f | 1 | #ifndef PREY_H |
| yumaowei | 2:5e54476c518f | 2 | #define PREY_H |
| yumaowei | 2:5e54476c518f | 3 | |
| yumaowei | 2:5e54476c518f | 4 | #include "mbed.h" |
| yumaowei | 2:5e54476c518f | 5 | #include "LCD.h" |
| yumaowei | 2:5e54476c518f | 6 | #include "Gamepad.h" |
| yumaowei | 2:5e54476c518f | 7 | #include "Predator.h" |
| yumaowei | 2:5e54476c518f | 8 | |
| yumaowei | 2:5e54476c518f | 9 | /** Prey Class |
| yumaowei | 2:5e54476c518f | 10 | @author Maowei Yu, University of Leeds |
| yumaowei | 2:5e54476c518f | 11 | @details the class controls the prey component in the game |
| yumaowei | 2:5e54476c518f | 12 | @date May 2020 |
| yumaowei | 2:5e54476c518f | 13 | */ |
| yumaowei | 2:5e54476c518f | 14 | class Prey |
| yumaowei | 2:5e54476c518f | 15 | { |
| yumaowei | 2:5e54476c518f | 16 | |
| yumaowei | 2:5e54476c518f | 17 | public: |
| yumaowei | 2:5e54476c518f | 18 | Prey(); |
| yumaowei | 2:5e54476c518f | 19 | ~Prey(); |
| yumaowei | 2:5e54476c518f | 20 | void init(int size,int speed); |
| yumaowei | 2:5e54476c518f | 21 | void draw(LCD &lcd); |
| yumaowei | 2:5e54476c518f | 22 | void update(); |
| yumaowei | 2:5e54476c518f | 23 | /// accessors and mutators |
| yumaowei | 2:5e54476c518f | 24 | void set_velocity(POS2D v); |
| yumaowei | 2:5e54476c518f | 25 | POS2D get_velocity(); |
| yumaowei | 2:5e54476c518f | 26 | POS2D get_pos(); |
| yumaowei | 2:5e54476c518f | 27 | void set_pos(POS2D p); |
| yumaowei | 2:5e54476c518f | 28 | |
| yumaowei | 2:5e54476c518f | 29 | private: |
| yumaowei | 2:5e54476c518f | 30 | |
| yumaowei | 2:5e54476c518f | 31 | POS2D _velocity; |
| yumaowei | 2:5e54476c518f | 32 | int _x; |
| yumaowei | 2:5e54476c518f | 33 | int _size; |
| yumaowei | 2:5e54476c518f | 34 | int _y; |
| yumaowei | 2:5e54476c518f | 35 | }; |
| yumaowei | 2:5e54476c518f | 36 | #endif |