
Simple vertical scrolling space shooter game using navigation switch (joystick), uLCD-144-G2, and a pushbutton switch.
Dependencies: 4DGL-uLCD-SE PinDetect mbed
Diff: Display/Rectangle.cpp
- Revision:
- 0:5c666e5cd22d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Display/Rectangle.cpp Thu Mar 17 20:47:11 2016 +0000 @@ -0,0 +1,21 @@ +#include "Rectangle.h" + +Rectangle::Rectangle() { + +} + +void Rectangle::init(int x, int y, uLCD_4DGL *uLCD) { + initSprite(x, y, uLCD); + setDimensions(4,4); +} + +void Rectangle::setDimensions(int height, int width) { + _height = height; + _width = width; +} + +void Rectangle::drawRect(int baseX, int baseY, int color) { + int newX = baseX + _x; + int newY = baseY + _y; + _uLCDptr->filled_rectangle(newX, newY, newX + _width, newY + _height, color); +} \ No newline at end of file