![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Adventure game written for ECE2035 at the Georgia Institute of Technology
Dependencies: mbed wave_player 4DGL-uLCD-SE MMA8452
graphics.h@2:0876296d9473, 2018-04-17 (annotated)
- Committer:
- trmontgomery
- Date:
- Tue Apr 17 17:17:20 2018 +0000
- Revision:
- 2:0876296d9473
- Parent:
- 0:35660d7952f7
- Child:
- 3:289762133fd6
Baseline completed + 3 features
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rconnorlawson | 0:35660d7952f7 | 1 | #ifndef GRAPHICS_H |
rconnorlawson | 0:35660d7952f7 | 2 | #define GRAPHICS_H |
rconnorlawson | 0:35660d7952f7 | 3 | |
trmontgomery | 2:0876296d9473 | 4 | #define PINK1 0xF442EB //P |
trmontgomery | 2:0876296d9473 | 5 | #define LIGHTPINK 0xF2B0EE //V |
trmontgomery | 2:0876296d9473 | 6 | #define YELLOW 0xFFFF00 |
rconnorlawson | 0:35660d7952f7 | 7 | |
rconnorlawson | 0:35660d7952f7 | 8 | /** |
rconnorlawson | 0:35660d7952f7 | 9 | * Draws the player. This depends on the player state, so it is not a DrawFunc. |
rconnorlawson | 0:35660d7952f7 | 10 | */ |
rconnorlawson | 0:35660d7952f7 | 11 | void draw_player(int u, int v, int key); |
trmontgomery | 2:0876296d9473 | 12 | void draw_npc(int u, int v); |
trmontgomery | 2:0876296d9473 | 13 | void draw_rock(int u, int v); |
trmontgomery | 2:0876296d9473 | 14 | void draw_door(int u, int v); |
trmontgomery | 2:0876296d9473 | 15 | void draw_goal(int u, int v); |
trmontgomery | 2:0876296d9473 | 16 | void draw_game_over(); |
rconnorlawson | 0:35660d7952f7 | 17 | |
rconnorlawson | 0:35660d7952f7 | 18 | /** |
rconnorlawson | 0:35660d7952f7 | 19 | * Takes a string image and draws it to the screen. The string is 121 characters |
rconnorlawson | 0:35660d7952f7 | 20 | * long, and represents an 11x11 tile in row-major ordering (across, then down, |
rconnorlawson | 0:35660d7952f7 | 21 | * like a regular multi-dimensional array). The available colors are: |
rconnorlawson | 0:35660d7952f7 | 22 | * R = Red |
rconnorlawson | 0:35660d7952f7 | 23 | * Y = Yellow |
rconnorlawson | 0:35660d7952f7 | 24 | * G = Green |
rconnorlawson | 0:35660d7952f7 | 25 | * D = Brown ("dirt") |
rconnorlawson | 0:35660d7952f7 | 26 | * 5 = Light grey (50%) |
rconnorlawson | 0:35660d7952f7 | 27 | * 3 = Dark grey (30%) |
rconnorlawson | 0:35660d7952f7 | 28 | * Any other character is black |
rconnorlawson | 0:35660d7952f7 | 29 | * More colors can be easily added by following the pattern already given. |
rconnorlawson | 0:35660d7952f7 | 30 | */ |
rconnorlawson | 0:35660d7952f7 | 31 | void draw_img(int u, int v, const char* img); |
rconnorlawson | 0:35660d7952f7 | 32 | |
rconnorlawson | 0:35660d7952f7 | 33 | /** |
rconnorlawson | 0:35660d7952f7 | 34 | * DrawFunc functions. |
rconnorlawson | 0:35660d7952f7 | 35 | * These can be used as the MapItem draw functions. |
rconnorlawson | 0:35660d7952f7 | 36 | */ |
rconnorlawson | 0:35660d7952f7 | 37 | void draw_nothing(int u, int v); |
rconnorlawson | 0:35660d7952f7 | 38 | void draw_wall(int u, int v); |
rconnorlawson | 0:35660d7952f7 | 39 | void draw_plant(int u, int v); |
trmontgomery | 2:0876296d9473 | 40 | void draw_spike(int u, int v); |
rconnorlawson | 0:35660d7952f7 | 41 | |
rconnorlawson | 0:35660d7952f7 | 42 | /** |
rconnorlawson | 0:35660d7952f7 | 43 | * Draw the upper status bar. |
rconnorlawson | 0:35660d7952f7 | 44 | */ |
trmontgomery | 2:0876296d9473 | 45 | void draw_upper_status(int health); |
rconnorlawson | 0:35660d7952f7 | 46 | |
rconnorlawson | 0:35660d7952f7 | 47 | /** |
rconnorlawson | 0:35660d7952f7 | 48 | * Draw the lower status bar. |
rconnorlawson | 0:35660d7952f7 | 49 | */ |
trmontgomery | 2:0876296d9473 | 50 | void draw_lower_status(int x, int y); |
rconnorlawson | 0:35660d7952f7 | 51 | |
rconnorlawson | 0:35660d7952f7 | 52 | /** |
rconnorlawson | 0:35660d7952f7 | 53 | * Draw the border for the map. |
rconnorlawson | 0:35660d7952f7 | 54 | */ |
rconnorlawson | 0:35660d7952f7 | 55 | void draw_border(); |
rconnorlawson | 0:35660d7952f7 | 56 | |
rconnorlawson | 0:35660d7952f7 | 57 | #endif // GRAPHICS_H |