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.
Diff: Hero/Hero.cpp
- Revision:
- 9:3a0194c87afe
- Parent:
- 8:d1c04f0e4890
--- a/Hero/Hero.cpp Sat May 11 08:23:54 2019 +0000
+++ b/Hero/Hero.cpp Sun May 12 16:21:08 2019 +0000
@@ -5,8 +5,8 @@
}
void Hero::init(int swidth, int sheight) {
- _x = swidth / 2;
- _y = sheight / 2;
+ _x = swidth / 2 - 5;
+ _y = sheight / 2 - 5;
// frame_counter = 0;
_health = 3;
// _health_rate = 50; possible addition
@@ -22,7 +22,21 @@
}
void Hero::draw(N5110 &lcd) {
- lcd.drawCircle( _x, _y, 5, FILL_TRANSPARENT);
+ //lcd.drawCircle( _x, _y, 5, FILL_TRANSPARENT);
+ int const hero[11][11] = {
+ {0,0,1,1,1,1,1,1,1,0,0},
+ {0,1,1,0,0,0,0,0,1,1,0},
+ {1,1,0,0,0,0,0,0,0,1,1},
+ {1,0,0,1,1,0,1,1,0,0,1},
+ {1,0,0,1,1,0,1,1,0,0,1},
+ {1,0,0,0,0,0,0,0,0,0,1},
+ {1,0,0,1,1,1,1,1,0,0,1},
+ {1,0,0,1,1,1,1,1,0,0,1},
+ {1,1,0,1,1,1,1,1,0,1,1},
+ {0,1,1,0,0,0,0,0,1,1,0},
+ {0,0,1,1,1,1,1,1,1,0,0},
+ };
+ lcd.drawSprite( _x, _y, 11, 11, (int *)hero);
}
int Hero::get_health() {