ECE 2035 final project
Dependencies: mbed wave_player 4DGL-uLCD-SE MMA8452
graphics.h@2:22d36e7740f1, 2019-04-15 (annotated)
- Committer:
- npatel387
- Date:
- Mon Apr 15 12:25:08 2019 +0000
- Revision:
- 2:22d36e7740f1
- Parent:
- 0:35660d7952f7
final;
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 | |
rconnorlawson | 0:35660d7952f7 | 4 | |
rconnorlawson | 0:35660d7952f7 | 5 | /** |
rconnorlawson | 0:35660d7952f7 | 6 | * Draws the player. This depends on the player state, so it is not a DrawFunc. |
rconnorlawson | 0:35660d7952f7 | 7 | */ |
rconnorlawson | 0:35660d7952f7 | 8 | void draw_player(int u, int v, int key); |
rconnorlawson | 0:35660d7952f7 | 9 | |
rconnorlawson | 0:35660d7952f7 | 10 | /** |
rconnorlawson | 0:35660d7952f7 | 11 | * Takes a string image and draws it to the screen. The string is 121 characters |
rconnorlawson | 0:35660d7952f7 | 12 | * long, and represents an 11x11 tile in row-major ordering (across, then down, |
rconnorlawson | 0:35660d7952f7 | 13 | * like a regular multi-dimensional array). The available colors are: |
rconnorlawson | 0:35660d7952f7 | 14 | * R = Red |
rconnorlawson | 0:35660d7952f7 | 15 | * Y = Yellow |
rconnorlawson | 0:35660d7952f7 | 16 | * G = Green |
rconnorlawson | 0:35660d7952f7 | 17 | * D = Brown ("dirt") |
rconnorlawson | 0:35660d7952f7 | 18 | * 5 = Light grey (50%) |
rconnorlawson | 0:35660d7952f7 | 19 | * 3 = Dark grey (30%) |
rconnorlawson | 0:35660d7952f7 | 20 | * Any other character is black |
rconnorlawson | 0:35660d7952f7 | 21 | * More colors can be easily added by following the pattern already given. |
rconnorlawson | 0:35660d7952f7 | 22 | */ |
rconnorlawson | 0:35660d7952f7 | 23 | void draw_img(int u, int v, const char* img); |
rconnorlawson | 0:35660d7952f7 | 24 | |
rconnorlawson | 0:35660d7952f7 | 25 | /** |
rconnorlawson | 0:35660d7952f7 | 26 | * DrawFunc functions. |
rconnorlawson | 0:35660d7952f7 | 27 | * These can be used as the MapItem draw functions. |
rconnorlawson | 0:35660d7952f7 | 28 | */ |
rconnorlawson | 0:35660d7952f7 | 29 | void draw_nothing(int u, int v); |
rconnorlawson | 0:35660d7952f7 | 30 | void draw_wall(int u, int v); |
rconnorlawson | 0:35660d7952f7 | 31 | void draw_plant(int u, int v); |
npatel387 | 2:22d36e7740f1 | 32 | void draw_startNPC(int u, int v); |
npatel387 | 2:22d36e7740f1 | 33 | void draw_cave(int u, int v); |
npatel387 | 2:22d36e7740f1 | 34 | void draw_swordInStone(int u, int v); |
npatel387 | 2:22d36e7740f1 | 35 | void draw_elvarg(int u, int v); |
npatel387 | 2:22d36e7740f1 | 36 | void draw_gate(int u, int v); |
npatel387 | 2:22d36e7740f1 | 37 | void draw_treasure(int u, int v); |
npatel387 | 2:22d36e7740f1 | 38 | void draw_boulder(int u, int v); |
npatel387 | 2:22d36e7740f1 | 39 | void draw_phat(int u, int v); |
npatel387 | 2:22d36e7740f1 | 40 | void draw_rolling(int u, int v); |
rconnorlawson | 0:35660d7952f7 | 41 | /** |
rconnorlawson | 0:35660d7952f7 | 42 | * Draw the upper status bar. |
rconnorlawson | 0:35660d7952f7 | 43 | */ |
npatel387 | 2:22d36e7740f1 | 44 | void draw_upper_status(int x_pos, int y_pos); |
rconnorlawson | 0:35660d7952f7 | 45 | |
rconnorlawson | 0:35660d7952f7 | 46 | /** |
rconnorlawson | 0:35660d7952f7 | 47 | * Draw the lower status bar. |
rconnorlawson | 0:35660d7952f7 | 48 | */ |
npatel387 | 2:22d36e7740f1 | 49 | void draw_lower_status(int health, int phats); |
rconnorlawson | 0:35660d7952f7 | 50 | |
npatel387 | 2:22d36e7740f1 | 51 | void draw_bad(); |
npatel387 | 2:22d36e7740f1 | 52 | void draw_good(); |
npatel387 | 2:22d36e7740f1 | 53 | void draw_start(); |
npatel387 | 2:22d36e7740f1 | 54 | void draw_menu(int omnipotent, int sword, int shield, int platebody, int key); |
rconnorlawson | 0:35660d7952f7 | 55 | /** |
rconnorlawson | 0:35660d7952f7 | 56 | * Draw the border for the map. |
rconnorlawson | 0:35660d7952f7 | 57 | */ |
rconnorlawson | 0:35660d7952f7 | 58 | void draw_border(); |
rconnorlawson | 0:35660d7952f7 | 59 | |
rconnorlawson | 0:35660d7952f7 | 60 | #endif // GRAPHICS_H |