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.
Sprite/Sprite.h@14:1e6f74233e8e, 2019-05-08 (annotated)
- Committer:
- joshdavy
- Date:
- Wed May 08 14:41:56 2019 +0000
- Revision:
- 14:1e6f74233e8e
- Parent:
- 10:58cf89dd878c
Documentation test
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
joshdavy | 1:37802772843e | 1 | #ifndef SPRITE_H |
joshdavy | 1:37802772843e | 2 | #define SPRITE_H |
joshdavy | 1:37802772843e | 3 | |
joshdavy | 1:37802772843e | 4 | #include "mbed.h" |
joshdavy | 1:37802772843e | 5 | #include "N5110.h" |
joshdavy | 1:37802772843e | 6 | #include "Gamepad.h" |
joshdavy | 1:37802772843e | 7 | #include "Bitmap.h" |
joshdavy | 1:37802772843e | 8 | |
joshdavy | 3:b34685dbdb8d | 9 | #define GRAVITY 2 |
joshdavy | 1:37802772843e | 10 | |
joshdavy | 10:58cf89dd878c | 11 | |
joshdavy | 14:1e6f74233e8e | 12 | /** Sprite Class |
joshdavy | 14:1e6f74233e8e | 13 | |
joshdavy | 14:1e6f74233e8e | 14 | @brief Sprite Class. Handles Sprites, their location,rendering and bitmaps. |
joshdavy | 14:1e6f74233e8e | 15 | @version 1.0 |
joshdavy | 14:1e6f74233e8e | 16 | |
joshdavy | 14:1e6f74233e8e | 17 | @author Joshua Davy el17jd |
joshdavy | 14:1e6f74233e8e | 18 | |
joshdavy | 14:1e6f74233e8e | 19 | @date April 2019 |
joshdavy | 14:1e6f74233e8e | 20 | |
joshdavy | 14:1e6f74233e8e | 21 | */ |
joshdavy | 1:37802772843e | 22 | |
joshdavy | 1:37802772843e | 23 | class Sprite { |
joshdavy | 1:37802772843e | 24 | |
joshdavy | 1:37802772843e | 25 | public: |
joshdavy | 1:37802772843e | 26 | Sprite(); |
joshdavy | 1:37802772843e | 27 | ~Sprite(); |
joshdavy | 1:37802772843e | 28 | void init(int height,int width, int * bitmap,Vector2D pos); |
joshdavy | 2:b62e8be35a5d | 29 | void render(N5110 &lcd); |
joshdavy | 9:96969b1c6bde | 30 | Vector2D get_pos(); |
joshdavy | 9:96969b1c6bde | 31 | void set_pos(Vector2D pos); |
joshdavy | 4:afbf3dd71403 | 32 | void setBitmap(int * bitmap); |
joshdavy | 2:b62e8be35a5d | 33 | |
joshdavy | 10:58cf89dd878c | 34 | protected: //Protected as will need to be accesible by child classes. |
joshdavy | 1:37802772843e | 35 | Vector2D _pos; |
joshdavy | 1:37802772843e | 36 | int _height; |
joshdavy | 1:37802772843e | 37 | int _width; |
joshdavy | 1:37802772843e | 38 | int * _bitmap; |
joshdavy | 1:37802772843e | 39 | }; |
joshdavy | 1:37802772843e | 40 | |
joshdavy | 1:37802772843e | 41 | #endif |