A rouge-like rpg, heavily inspired on the binding of isaac. Running on a FRDM-K64F Mbed board. C++.
Dependencies: mbed MotionSensor
Diff: N5110/N5110.cpp
- Revision:
- 4:d1aeb131e533
- Parent:
- 0:8e92b66a0755
- Child:
- 23:5a8f75e93508
diff -r 359a49bace1b -r d1aeb131e533 N5110/N5110.cpp --- a/N5110/N5110.cpp Mon Apr 15 02:12:32 2019 +0000 +++ b/N5110/N5110.cpp Mon Apr 15 02:28:55 2019 +0000 @@ -494,4 +494,24 @@ setPixel(x0+j,y0+i, pixel); } } +} + +void N5110::drawSpriteTransparent(int x0, + int y0, + int nrows, + int ncols, + int *sprite) +{ + for (int i = 0; i < nrows; i++) { + for (int j = 0 ; j < ncols ; j++) { + + int pixel = *((sprite+i*ncols)+j); + if (pixel != 0) { + if (pixel == 2) { + pixel = 0; + } + setPixel(x0+j,y0+i, pixel); + } + } + } } \ No newline at end of file