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.
Fork of fy15raf by
Diff: Rocket/Rocket.cpp
- Revision:
- 7:06c86ec1f19d
- Parent:
- 6:7b733b2a6cf6
- Child:
- 9:e70179ff61c5
--- a/Rocket/Rocket.cpp Fri Apr 20 21:03:05 2018 +0000 +++ b/Rocket/Rocket.cpp Tue Apr 24 10:17:39 2018 +0000 @@ -68,7 +68,6 @@ return p; } - void Rocket::add_score() { _score++; @@ -77,4 +76,43 @@ int Rocket::get_score() { return _score; +} + +void Rocket::drawFullHearts(N5110 &lcd) +{ + int sprite[5][17] = { + + { 1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1, }, + { 1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1, }, + { 1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1, }, + { 0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,0, }, + { 0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0, }, +}; + lcd.drawSprite(0,0,5,17,(int *)sprite); +} + +void Rocket::drawTwoHearts(N5110 &lcd) +{ + int sprite[5][17] = { + + { 1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1, }, + { 1,1,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1, }, + { 1,1,1,1,1,0,1,1,1,1,1,0,1,0,0,0,1, }, + { 0,1,1,1,0,0,0,1,1,1,0,0,0,1,0,1,0, }, + { 0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0, }, +}; + lcd.drawSprite(0,0,5,17,(int *)sprite); +} + +void Rocket::drawOneHeart(N5110 &lcd) +{ + int sprite[5][17] = { + + { 1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1, }, + { 1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1, }, + { 1,1,1,1,1,0,1,0,0,0,1,0,1,0,0,0,1, }, + { 0,1,1,1,0,0,0,1,0,1,0,0,0,1,0,1,0, }, + { 0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0, }, +}; + lcd.drawSprite(1,1,5,17,(int *)sprite); } \ No newline at end of file