Code for the first mbed for the drum hero project
Dependencies: 4DGL SDFileSystem mbed
Fork of drums2 by
Note/note.h@3:54d4226a7d5e, 2017-04-30 (annotated)
- Committer:
- ckabuloglu
- Date:
- Sun Apr 30 00:55:41 2017 +0000
- Revision:
- 3:54d4226a7d5e
mbed1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ckabuloglu | 3:54d4226a7d5e | 1 | #ifndef NOTE_H__ |
ckabuloglu | 3:54d4226a7d5e | 2 | #define NOTE_H__ |
ckabuloglu | 3:54d4226a7d5e | 3 | |
ckabuloglu | 3:54d4226a7d5e | 4 | #define MIN_Y 130 |
ckabuloglu | 3:54d4226a7d5e | 5 | #define MAX_Y 430 |
ckabuloglu | 3:54d4226a7d5e | 6 | |
ckabuloglu | 3:54d4226a7d5e | 7 | class Note { |
ckabuloglu | 3:54d4226a7d5e | 8 | public: |
ckabuloglu | 3:54d4226a7d5e | 9 | |
ckabuloglu | 3:54d4226a7d5e | 10 | // Type of the note (1,2,3) - (left, center, right) |
ckabuloglu | 3:54d4226a7d5e | 11 | int type; |
ckabuloglu | 3:54d4226a7d5e | 12 | |
ckabuloglu | 3:54d4226a7d5e | 13 | // Position accros the fret |
ckabuloglu | 3:54d4226a7d5e | 14 | float x,y; |
ckabuloglu | 3:54d4226a7d5e | 15 | |
ckabuloglu | 3:54d4226a7d5e | 16 | // Sizes of the displayed note |
ckabuloglu | 3:54d4226a7d5e | 17 | float w,h; |
ckabuloglu | 3:54d4226a7d5e | 18 | |
ckabuloglu | 3:54d4226a7d5e | 19 | // Speed of the the note |
ckabuloglu | 3:54d4226a7d5e | 20 | int speed; |
ckabuloglu | 3:54d4226a7d5e | 21 | |
ckabuloglu | 3:54d4226a7d5e | 22 | // Color of the note |
ckabuloglu | 3:54d4226a7d5e | 23 | int color; |
ckabuloglu | 3:54d4226a7d5e | 24 | |
ckabuloglu | 3:54d4226a7d5e | 25 | // Flag showing if the note is already consumed |
ckabuloglu | 3:54d4226a7d5e | 26 | int consumed; |
ckabuloglu | 3:54d4226a7d5e | 27 | |
ckabuloglu | 3:54d4226a7d5e | 28 | // Constructor of the note, no args |
ckabuloglu | 3:54d4226a7d5e | 29 | Note(); |
ckabuloglu | 3:54d4226a7d5e | 30 | |
ckabuloglu | 3:54d4226a7d5e | 31 | // Constructor of the note, initiate with type |
ckabuloglu | 3:54d4226a7d5e | 32 | Note(int t); |
ckabuloglu | 3:54d4226a7d5e | 33 | |
ckabuloglu | 3:54d4226a7d5e | 34 | // Destructor for the note |
ckabuloglu | 3:54d4226a7d5e | 35 | ~Note(); |
ckabuloglu | 3:54d4226a7d5e | 36 | |
ckabuloglu | 3:54d4226a7d5e | 37 | // Update the position of the note based on its speed |
ckabuloglu | 3:54d4226a7d5e | 38 | void updatePosition(); |
ckabuloglu | 3:54d4226a7d5e | 39 | |
ckabuloglu | 3:54d4226a7d5e | 40 | // Draw the note with its current stats on the screen |
ckabuloglu | 3:54d4226a7d5e | 41 | void drawNote(); |
ckabuloglu | 3:54d4226a7d5e | 42 | |
ckabuloglu | 3:54d4226a7d5e | 43 | }; |
ckabuloglu | 3:54d4226a7d5e | 44 | #endif |