![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Game For ECE 2035
Dependencies: mbed wave_player 4DGL-uLCD-SE MMA8452
speech.cpp@4:37d3935365f8, 2021-09-28 (annotated)
- Committer:
- lballard9
- Date:
- Tue Sep 28 13:52:11 2021 +0000
- Revision:
- 4:37d3935365f8
- Parent:
- 0:35660d7952f7
- Child:
- 6:c9695079521d
Fall 2021 notes added
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rconnorlawson | 0:35660d7952f7 | 1 | #include "speech.h" |
rconnorlawson | 0:35660d7952f7 | 2 | |
rconnorlawson | 0:35660d7952f7 | 3 | #include "globals.h" |
rconnorlawson | 0:35660d7952f7 | 4 | #include "hardware.h" |
rconnorlawson | 0:35660d7952f7 | 5 | |
rconnorlawson | 0:35660d7952f7 | 6 | /** |
rconnorlawson | 0:35660d7952f7 | 7 | * Draw the speech bubble background. |
lballard9 | 4:37d3935365f8 | 8 | * Use this file to draw speech bubbles, look at the uLCD libraries for printing |
lballard9 | 4:37d3935365f8 | 9 | * text to the uLCD (see graphics.cpp note for link) |
rconnorlawson | 0:35660d7952f7 | 10 | */ |
rconnorlawson | 0:35660d7952f7 | 11 | static void draw_speech_bubble(); |
rconnorlawson | 0:35660d7952f7 | 12 | |
rconnorlawson | 0:35660d7952f7 | 13 | /** |
rconnorlawson | 0:35660d7952f7 | 14 | * Erase the speech bubble. |
rconnorlawson | 0:35660d7952f7 | 15 | */ |
rconnorlawson | 0:35660d7952f7 | 16 | static void erase_speech_bubble(); |
rconnorlawson | 0:35660d7952f7 | 17 | |
rconnorlawson | 0:35660d7952f7 | 18 | /** |
rconnorlawson | 0:35660d7952f7 | 19 | * Draw a single line of the speech bubble. |
rconnorlawson | 0:35660d7952f7 | 20 | * @param line The text to display |
rconnorlawson | 0:35660d7952f7 | 21 | * @param which If TOP, the first line; if BOTTOM, the second line. |
rconnorlawson | 0:35660d7952f7 | 22 | */ |
rconnorlawson | 0:35660d7952f7 | 23 | #define TOP 0 |
rconnorlawson | 0:35660d7952f7 | 24 | #define BOTTOM 1 |
rconnorlawson | 0:35660d7952f7 | 25 | static void draw_speech_line(const char* line, int which); |
rconnorlawson | 0:35660d7952f7 | 26 | |
rconnorlawson | 0:35660d7952f7 | 27 | /** |
rconnorlawson | 0:35660d7952f7 | 28 | * Delay until it is time to scroll. |
rconnorlawson | 0:35660d7952f7 | 29 | */ |
rconnorlawson | 0:35660d7952f7 | 30 | static void speech_bubble_wait(); |
rconnorlawson | 0:35660d7952f7 | 31 | |
rconnorlawson | 0:35660d7952f7 | 32 | void draw_speech_bubble() |
rconnorlawson | 0:35660d7952f7 | 33 | { |
rconnorlawson | 0:35660d7952f7 | 34 | } |
rconnorlawson | 0:35660d7952f7 | 35 | |
rconnorlawson | 0:35660d7952f7 | 36 | void erase_speech_bubble() |
rconnorlawson | 0:35660d7952f7 | 37 | { |
rconnorlawson | 0:35660d7952f7 | 38 | } |
rconnorlawson | 0:35660d7952f7 | 39 | |
rconnorlawson | 0:35660d7952f7 | 40 | void draw_speech_line(const char* line, int which) |
rconnorlawson | 0:35660d7952f7 | 41 | { |
rconnorlawson | 0:35660d7952f7 | 42 | } |
rconnorlawson | 0:35660d7952f7 | 43 | |
rconnorlawson | 0:35660d7952f7 | 44 | void speech_bubble_wait() |
rconnorlawson | 0:35660d7952f7 | 45 | { |
rconnorlawson | 0:35660d7952f7 | 46 | } |
rconnorlawson | 0:35660d7952f7 | 47 | |
rconnorlawson | 0:35660d7952f7 | 48 | void speech(const char* line1, const char* line2) |
rconnorlawson | 0:35660d7952f7 | 49 | { |
rconnorlawson | 0:35660d7952f7 | 50 | draw_speech_bubble(); |
rconnorlawson | 0:35660d7952f7 | 51 | draw_speech_line(line1, TOP); |
rconnorlawson | 0:35660d7952f7 | 52 | draw_speech_line(line2, BOTTOM); |
rconnorlawson | 0:35660d7952f7 | 53 | speech_bubble_wait(); |
rconnorlawson | 0:35660d7952f7 | 54 | erase_speech_bubble(); |
rconnorlawson | 0:35660d7952f7 | 55 | } |
rconnorlawson | 0:35660d7952f7 | 56 | |
rconnorlawson | 0:35660d7952f7 | 57 | void long_speech(const char* lines[], int n) |
rconnorlawson | 0:35660d7952f7 | 58 | { |
rconnorlawson | 0:35660d7952f7 | 59 | } |