SharpShooter
Dependencies: 4DGL-uLCD-SE SDFileSystem mbed-rtos mbed wave_player
Diff: Shooter.h
- Revision:
- 6:7f8c3169483a
- Parent:
- 5:f51cdddf541e
- Child:
- 11:55b65415b6ba
--- a/Shooter.h Fri Oct 28 00:36:11 2016 +0000 +++ b/Shooter.h Fri Oct 28 01:00:49 2016 +0000 @@ -1,14 +1,41 @@ class Shooter { int x; - + uLCD_4DGL uLCD; + public: Shooter(); void drawShooter(); + void eraseShooter(); + void moveLeft(); + void moveRight(); }; Shooter::Shooter() { x = 64; } -//void Shooter::drawShooter \ No newline at end of file +void Shooter::drawShooter() { + uLCD.triangle(x, 115, x-5, 125, x-5, 125, 0x3300ff); +} + +void Shooter::eraseShooter() { + uLCD.triangle(x, 115, x-5, 125, x-5, 125, 0x000000); +} + +void Shooter::moveLeft() { + eraseShooter(); + if (x==64) x = 32; + if (x==96) x = 64; + drawShooter(); +} + +void Shooter::moveRight() { + eraseShooter(); + if (x==64) x = 96; + if (x==32) x = 64; + drawShooter(); +} + + + \ No newline at end of file