ECE 4180 Final
Dependencies: mbed wave_player mbed-rtos C12832_lcd 4DGL-uLCD-SE LCD_fonts SDFileSystem
Bubble.hpp@20:7d56cdcbc9a5, 2019-12-06 (annotated)
- Committer:
- jcrane32
- Date:
- Fri Dec 06 18:00:11 2019 +0000
- Revision:
- 20:7d56cdcbc9a5
- Parent:
- 19:d65f9fb1023b
TODO: fix status LED (tracks bubblesMissed) and add in scoreboard at the end.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jcrane32 | 19:d65f9fb1023b | 1 | #ifndef bubble_hpp |
jcrane32 | 19:d65f9fb1023b | 2 | #define bubble_hpp |
jcrane32 | 19:d65f9fb1023b | 3 | |
jcrane32 | 19:d65f9fb1023b | 4 | #include "globals.h" |
jcrane32 | 19:d65f9fb1023b | 5 | |
jcrane32 | 19:d65f9fb1023b | 6 | class Bubble |
jcrane32 | 19:d65f9fb1023b | 7 | { |
jcrane32 | 19:d65f9fb1023b | 8 | public: |
jcrane32 | 19:d65f9fb1023b | 9 | Bubble(int x, int y); |
jcrane32 | 19:d65f9fb1023b | 10 | void draw(); |
jcrane32 | 19:d65f9fb1023b | 11 | void moveDown(); |
jcrane32 | 19:d65f9fb1023b | 12 | int getYpos(); |
jcrane32 | 19:d65f9fb1023b | 13 | void clear(); |
jcrane32 | 19:d65f9fb1023b | 14 | |
jcrane32 | 19:d65f9fb1023b | 15 | private: |
jcrane32 | 19:d65f9fb1023b | 16 | void update(); |
jcrane32 | 19:d65f9fb1023b | 17 | int xpos; |
jcrane32 | 19:d65f9fb1023b | 18 | int ypos; |
jcrane32 | 19:d65f9fb1023b | 19 | int newypos; |
jcrane32 | 19:d65f9fb1023b | 20 | |
jcrane32 | 19:d65f9fb1023b | 21 | // these may need to be adjusted to prevent weird visual artifacts if |
jcrane32 | 19:d65f9fb1023b | 22 | // bubbles collide |
jcrane32 | 20:7d56cdcbc9a5 | 23 | const static int bubbleSpeed = 15; |
jcrane32 | 20:7d56cdcbc9a5 | 24 | const static int bubbleRadius = 10; |
jcrane32 | 19:d65f9fb1023b | 25 | }; |
jcrane32 | 19:d65f9fb1023b | 26 | |
jcrane32 | 19:d65f9fb1023b | 27 | #endif //bubble_hpp |