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 N5110 by
Diff: N5110.cpp
- Revision:
- 20:9a847cf7585d
- Parent:
- 19:ba8addc061ea
- Child:
- 21:837ccf2bb6d3
--- a/N5110.cpp Thu Apr 23 18:57:52 2015 +0000 +++ b/N5110.cpp Tue May 03 10:37:11 2016 +0000 @@ -404,3 +404,121 @@ } } + +void N5110::drawCar(int x0,int y0,int fill) +{ + drawRect(x0+2,y0,1,5,fill); + drawRect(x0,y0+2,5,1,fill); + drawRect(x0,y0+6,1,1,fill); + drawRect(x0+4,y0+6,1,1,fill); +} + +void N5110::drawHeart(int x0,int y0,int value,int fill) +{ + + for(int x=1; x<=value; x++) { + + if(fill==1) { + drawLine(x0,y0+2,x0,y0+1,1); + drawLine(x0+1,y0+3,x0+1,y0,1); + drawLine(x0+2,y0+4,x0+2,y0,1); + drawLine(x0+3,y0+5,x0+3,y0+1,1); + drawLine(x0+4,y0+4,x0+4,y0,1); + drawLine(x0+5,y0+3,x0+5,y0,1); + drawLine(x0+6,y0+2,x0+6,y0+1,1); + } else { + drawLine(x0+4,y0,x0+2,y0,2); + drawLine(x0+3,y0+1,x0+3,y0+1,1); + drawLine(x0+1,y0,x0,y0+1,1); + drawLine(x0+6,y0+1,x0+5,y0,1); + drawLine(x0+3,y0+5,x0,y0+2,1); + drawLine(x0+6,y0+2,x0+3,y0+5,1); + } + + if (x==3) { + x0=x0-16; + y0=y0+7; + } else { + x0=x0+8; + } + } +} + +void N5110::score(int m,int my) +{ + //show score title + setPixel(m,my); + setPixel(m,my+1); + setPixel(m,my+2); + setPixel(m,my+4); + setPixel(m+1,my); + setPixel(m+1,my+2); + setPixel(m+1,my+4); + setPixel(m+2,my); + setPixel(m+2,my+2); + setPixel(m+2,my+3); + setPixel(m+2,my+4); + setPixel(m+4,my); + setPixel(m+4,my+1); + setPixel(m+4,my+2); + setPixel(m+4,my+3); + setPixel(m+4,my+4); + setPixel(m+5,my); + setPixel(m+5,my+4); + setPixel(m+6,my); + setPixel(m+6,my+4); + setPixel(m+8,my); + setPixel(m+8,my+1); + setPixel(m+8,my+2); + setPixel(m+8,my+3); + setPixel(m+8,my+4); + setPixel(m+9,my); + setPixel(m+9,my+4); + setPixel(m+10,my); + setPixel(m+10,my+1); + setPixel(m+10,my+2); + setPixel(m+10,my+3); + setPixel(m+10,my+4); + setPixel(m+12,my); + setPixel(m+12,my+1); + setPixel(m+12,my+2); + setPixel(m+12,my+3); + setPixel(m+12,my+4); + setPixel(m+13,my); + setPixel(m+13,my+2); + setPixel(m+14,my); + setPixel(m+14,my+1); + setPixel(m+14,my+3); + setPixel(m+14,my+4); + setPixel(m+16,my); + setPixel(m+16,my+1); + setPixel(m+16,my+2); + setPixel(m+16,my+3); + setPixel(m+16,my+4); + setPixel(m+17,my); + setPixel(m+17,my+2); + setPixel(m+17,my+4); + setPixel(m+18,my); + setPixel(m+18,my+4); +} + +void N5110::level(int x1,int y1) +{ + int x0=x1; + int y0=y1; + drawLine(x1,y1+4,x0,y0,1); + drawLine(x1+2,y1+4,x0,y0+4,1); + drawLine(x1+4,y1+4,x0+4,y0,1); + drawLine(x1+6,y1,x0+4,y0,1); + drawLine(x1+6,y1+4,x0+4,y0+4,1); + setPixel(x1+5,y1+2); + drawLine(x1+8,y1+3,x0+8,y0,1); + drawLine(x1+10,y1+3,x0+10,y0,1); + setPixel(x1+9,y1+4); + drawLine(x1+12,y1+4,x0+12,y0,1); + drawLine(x1+14,y1,x0+12,y0,1); + drawLine(x1+14,y1+4,x0+12,y0+4,1); + setPixel(x1+13,y1+2); + drawLine(x1+16,y1+4,x0+16,y0,1); + drawLine(x1+18,y1+4,x0+16,y0+4,1); +} \ No newline at end of file