Simple vertical scrolling space shooter game using navigation switch (joystick), uLCD-144-G2, and a pushbutton switch.
Dependencies: 4DGL-uLCD-SE PinDetect mbed
Display/Star.cpp
- Committer:
- jaspinall3
- Date:
- 2016-03-17
- Revision:
- 0:5c666e5cd22d
File content as of revision 0:5c666e5cd22d:
#include "Star.h" Star::Star( uLCD_4DGL *uLCD) { _x = (int)(((float) rand() / (RAND_MAX))*127); _y = 0; _dy = 10; _uLCDptr = uLCD; } void Star::update() { _y += _dy; _uLCDptr->pixel(_x, _y, 0xFFFFFF); } int Star::offScreen() { if(_y + _dy >= 127) { return 1; } else { return 0; } }