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/Collectibles/Health/Health.cpp@59:fd4669864b67, 2019-05-09 (annotated)
- Committer:
- el17sm
- Date:
- Thu May 09 14:49:27 2019 +0000
- Revision:
- 59:fd4669864b67
- Parent:
- 57:1c12361b6e3d
wtf y no work
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| el17sm | 32:fe6359ef9916 | 1 | #include "Health.h" |
| el17sm | 32:fe6359ef9916 | 2 | |
| el17sm | 32:fe6359ef9916 | 3 | Health::Health(float pos_x, float pos_y) |
| el17sm | 32:fe6359ef9916 | 4 | { |
| el17sm | 57:1c12361b6e3d | 5 | _hp = 1; |
| el17sm | 57:1c12361b6e3d | 6 | _attack = -1; |
| el17sm | 37:a404860171a9 | 7 | |
| el17sm | 57:1c12361b6e3d | 8 | _hitbox.width = 7; |
| el17sm | 57:1c12361b6e3d | 9 | _hitbox.height = 7; |
| el17sm | 37:a404860171a9 | 10 | |
| el17sm | 57:1c12361b6e3d | 11 | _position.x = pos_x; |
| el17sm | 57:1c12361b6e3d | 12 | _position.y = pos_y; |
| el17sm | 37:a404860171a9 | 13 | |
| el17sm | 57:1c12361b6e3d | 14 | _sprite_size.width = 7; |
| el17sm | 57:1c12361b6e3d | 15 | _sprite_size.height = 7; |
| el17sm | 57:1c12361b6e3d | 16 | _sprite_size.offset_x = 0; |
| el17sm | 57:1c12361b6e3d | 17 | _sprite_size.offset_y = 0; |
| el17sm | 32:fe6359ef9916 | 18 | } |
| el17sm | 32:fe6359ef9916 | 19 | |
| el17sm | 56:ef9521b7ed78 | 20 | void Health::move(float unused, float unused1, char * unused2, bool * unused3) // Health doesnt move, only typed out since the virtual function is pure |
| el17sm | 32:fe6359ef9916 | 21 | { |
| el17sm | 32:fe6359ef9916 | 22 | |
| el17sm | 32:fe6359ef9916 | 23 | } |
| el17sm | 32:fe6359ef9916 | 24 | |
| el17sm | 32:fe6359ef9916 | 25 | void Health::draw(N5110 &lcd) |
| el17sm | 32:fe6359ef9916 | 26 | { |
| el17sm | 57:1c12361b6e3d | 27 | lcd.drawSpriteTransparent(_position.x+_sprite_size.offset_x, |
| el17sm | 57:1c12361b6e3d | 28 | _position.y+_sprite_size.offset_y, |
| el17sm | 57:1c12361b6e3d | 29 | _sprite_size.height, |
| el17sm | 57:1c12361b6e3d | 30 | _sprite_size.width, |
| el17sm | 37:a404860171a9 | 31 | (char *) health_sprite); |
| el17sm | 32:fe6359ef9916 | 32 | } |
| el17sm | 32:fe6359ef9916 | 33 | |
| el17sm | 32:fe6359ef9916 | 34 | void Health::take_damage(int damage) |
| el17sm | 32:fe6359ef9916 | 35 | { |
| el17sm | 57:1c12361b6e3d | 36 | _hp -= damage; |
| el17sm | 32:fe6359ef9916 | 37 | } |