![](/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@3:289762133fd6, 2018-04-18 (annotated)
- Committer:
- trmontgomery
- Date:
- Wed Apr 18 20:18:51 2018 +0000
- Revision:
- 3:289762133fd6
- Parent:
- 2:0876296d9473
- Child:
- 4:cdc54191ff07
The second map works!
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(); |
trmontgomery | 3:289762133fd6 | 17 | void draw_house_floor(int u, int v); |
rconnorlawson | 0:35660d7952f7 | 18 | |
rconnorlawson | 0:35660d7952f7 | 19 | /** |
rconnorlawson | 0:35660d7952f7 | 20 | * Takes a string image and draws it to the screen. The string is 121 characters |
rconnorlawson | 0:35660d7952f7 | 21 | * long, and represents an 11x11 tile in row-major ordering (across, then down, |
rconnorlawson | 0:35660d7952f7 | 22 | * like a regular multi-dimensional array). The available colors are: |
rconnorlawson | 0:35660d7952f7 | 23 | * R = Red |
rconnorlawson | 0:35660d7952f7 | 24 | * Y = Yellow |
rconnorlawson | 0:35660d7952f7 | 25 | * G = Green |
rconnorlawson | 0:35660d7952f7 | 26 | * D = Brown ("dirt") |
rconnorlawson | 0:35660d7952f7 | 27 | * 5 = Light grey (50%) |
rconnorlawson | 0:35660d7952f7 | 28 | * 3 = Dark grey (30%) |
rconnorlawson | 0:35660d7952f7 | 29 | * Any other character is black |
rconnorlawson | 0:35660d7952f7 | 30 | * More colors can be easily added by following the pattern already given. |
rconnorlawson | 0:35660d7952f7 | 31 | */ |
rconnorlawson | 0:35660d7952f7 | 32 | void draw_img(int u, int v, const char* img); |
rconnorlawson | 0:35660d7952f7 | 33 | |
rconnorlawson | 0:35660d7952f7 | 34 | /** |
rconnorlawson | 0:35660d7952f7 | 35 | * DrawFunc functions. |
rconnorlawson | 0:35660d7952f7 | 36 | * These can be used as the MapItem draw functions. |
rconnorlawson | 0:35660d7952f7 | 37 | */ |
rconnorlawson | 0:35660d7952f7 | 38 | void draw_nothing(int u, int v); |
rconnorlawson | 0:35660d7952f7 | 39 | void draw_wall(int u, int v); |
rconnorlawson | 0:35660d7952f7 | 40 | void draw_plant(int u, int v); |
trmontgomery | 2:0876296d9473 | 41 | void draw_spike(int u, int v); |
rconnorlawson | 0:35660d7952f7 | 42 | |
rconnorlawson | 0:35660d7952f7 | 43 | /** |
rconnorlawson | 0:35660d7952f7 | 44 | * Draw the upper status bar. |
rconnorlawson | 0:35660d7952f7 | 45 | */ |
trmontgomery | 2:0876296d9473 | 46 | void draw_upper_status(int health); |
rconnorlawson | 0:35660d7952f7 | 47 | |
rconnorlawson | 0:35660d7952f7 | 48 | /** |
rconnorlawson | 0:35660d7952f7 | 49 | * Draw the lower status bar. |
rconnorlawson | 0:35660d7952f7 | 50 | */ |
trmontgomery | 2:0876296d9473 | 51 | void draw_lower_status(int x, int y); |
rconnorlawson | 0:35660d7952f7 | 52 | |
rconnorlawson | 0:35660d7952f7 | 53 | /** |
rconnorlawson | 0:35660d7952f7 | 54 | * Draw the border for the map. |
rconnorlawson | 0:35660d7952f7 | 55 | */ |
rconnorlawson | 0:35660d7952f7 | 56 | void draw_border(); |
rconnorlawson | 0:35660d7952f7 | 57 | |
rconnorlawson | 0:35660d7952f7 | 58 | #endif // GRAPHICS_H |