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 MotionSensor
Entity/Player/Bullets/Bullets.h@32:fe6359ef9916, 2019-05-06 (annotated)
- Committer:
- el17sm
- Date:
- Mon May 06 08:56:48 2019 +0000
- Revision:
- 32:fe6359ef9916
- Child:
- 33:4f3948dcd2f7
A bit of code cleanup;; Draw functions are now inside the classes;; Moved classes into it's folders;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| el17sm | 32:fe6359ef9916 | 1 | #ifndef BULLETS_H |
| el17sm | 32:fe6359ef9916 | 2 | #define BULLETS_H |
| el17sm | 32:fe6359ef9916 | 3 | #include "Entity.h" |
| el17sm | 32:fe6359ef9916 | 4 | |
| el17sm | 32:fe6359ef9916 | 5 | class Bullets : public Entity |
| el17sm | 32:fe6359ef9916 | 6 | { |
| el17sm | 32:fe6359ef9916 | 7 | |
| el17sm | 32:fe6359ef9916 | 8 | public: |
| el17sm | 32:fe6359ef9916 | 9 | // Constructor |
| el17sm | 32:fe6359ef9916 | 10 | Bullets(float, float, int); |
| el17sm | 32:fe6359ef9916 | 11 | |
| el17sm | 32:fe6359ef9916 | 12 | // Functions |
| el17sm | 32:fe6359ef9916 | 13 | virtual void move(float, float, int * map, bool * doorways); |
| el17sm | 32:fe6359ef9916 | 14 | virtual void draw(N5110 &lcd); |
| el17sm | 32:fe6359ef9916 | 15 | virtual void take_damage(int damage); |
| el17sm | 32:fe6359ef9916 | 16 | bool out_of_bounds_check(int * map, bool * doorways); |
| el17sm | 32:fe6359ef9916 | 17 | |
| el17sm | 32:fe6359ef9916 | 18 | private: |
| el17sm | 32:fe6359ef9916 | 19 | // Private Functions |
| el17sm | 32:fe6359ef9916 | 20 | int * get_frame(); |
| el17sm | 32:fe6359ef9916 | 21 | // Member Variable |
| el17sm | 32:fe6359ef9916 | 22 | int direction; |
| el17sm | 32:fe6359ef9916 | 23 | }; |
| el17sm | 32:fe6359ef9916 | 24 | |
| el17sm | 32:fe6359ef9916 | 25 | const int bullets_sprite[3][3] = {{1,1,1}, |
| el17sm | 32:fe6359ef9916 | 26 | {1,1,1}, |
| el17sm | 32:fe6359ef9916 | 27 | {1,1,1} |
| el17sm | 32:fe6359ef9916 | 28 | }; |
| el17sm | 32:fe6359ef9916 | 29 | |
| el17sm | 32:fe6359ef9916 | 30 | #endif |