Game For ECE 2035
Dependencies: mbed wave_player 4DGL-uLCD-SE MMA8452
graphics.h@10:e18685911e84, 2021-12-01 (annotated)
- Committer:
- nasiromar
- Date:
- Wed Dec 01 22:07:24 2021 +0000
- Revision:
- 10:e18685911e84
- Parent:
- 7:862062ffca62
- Child:
- 11:6cd02a8539d1
Walk;
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 | |
nasiromar | 6:c9695079521d | 5 | |
rconnorlawson | 0:35660d7952f7 | 6 | /** |
rconnorlawson | 0:35660d7952f7 | 7 | * Draws the player. This depends on the player state, so it is not a DrawFunc. |
rconnorlawson | 0:35660d7952f7 | 8 | */ |
rconnorlawson | 0:35660d7952f7 | 9 | void draw_player(int u, int v, int key); |
rconnorlawson | 0:35660d7952f7 | 10 | |
rconnorlawson | 0:35660d7952f7 | 11 | /** |
rconnorlawson | 0:35660d7952f7 | 12 | * Takes a string image and draws it to the screen. The string is 121 characters |
rconnorlawson | 0:35660d7952f7 | 13 | * long, and represents an 11x11 tile in row-major ordering (across, then down, |
rconnorlawson | 0:35660d7952f7 | 14 | * like a regular multi-dimensional array). The available colors are: |
rconnorlawson | 0:35660d7952f7 | 15 | * R = Red |
rconnorlawson | 0:35660d7952f7 | 16 | * Y = Yellow |
rconnorlawson | 0:35660d7952f7 | 17 | * G = Green |
rconnorlawson | 0:35660d7952f7 | 18 | * D = Brown ("dirt") |
rconnorlawson | 0:35660d7952f7 | 19 | * 5 = Light grey (50%) |
rconnorlawson | 0:35660d7952f7 | 20 | * 3 = Dark grey (30%) |
rconnorlawson | 0:35660d7952f7 | 21 | * Any other character is black |
rconnorlawson | 0:35660d7952f7 | 22 | * More colors can be easily added by following the pattern already given. |
rconnorlawson | 0:35660d7952f7 | 23 | */ |
rconnorlawson | 0:35660d7952f7 | 24 | void draw_img(int u, int v, const char* img); |
rconnorlawson | 0:35660d7952f7 | 25 | |
rconnorlawson | 0:35660d7952f7 | 26 | /** |
rconnorlawson | 0:35660d7952f7 | 27 | * DrawFunc functions. |
rconnorlawson | 0:35660d7952f7 | 28 | * These can be used as the MapItem draw functions. |
rconnorlawson | 0:35660d7952f7 | 29 | */ |
rconnorlawson | 0:35660d7952f7 | 30 | void draw_nothing(int u, int v); |
rconnorlawson | 0:35660d7952f7 | 31 | void draw_wall(int u, int v); |
rconnorlawson | 0:35660d7952f7 | 32 | void draw_plant(int u, int v); |
rconnorlawson | 0:35660d7952f7 | 33 | |
rconnorlawson | 0:35660d7952f7 | 34 | /** |
rconnorlawson | 0:35660d7952f7 | 35 | * Draw the upper status bar. |
rconnorlawson | 0:35660d7952f7 | 36 | */ |
nasiromar | 6:c9695079521d | 37 | void draw_upper_status(int x, int y); |
rconnorlawson | 0:35660d7952f7 | 38 | |
rconnorlawson | 0:35660d7952f7 | 39 | /** |
rconnorlawson | 0:35660d7952f7 | 40 | * Draw the lower status bar. |
rconnorlawson | 0:35660d7952f7 | 41 | */ |
nasiromar | 6:c9695079521d | 42 | void draw_lower_status(int hp, int mp); |
rconnorlawson | 0:35660d7952f7 | 43 | |
rconnorlawson | 0:35660d7952f7 | 44 | /** |
rconnorlawson | 0:35660d7952f7 | 45 | * Draw the border for the map. |
rconnorlawson | 0:35660d7952f7 | 46 | */ |
nasiromar | 10:e18685911e84 | 47 | |
nasiromar | 10:e18685911e84 | 48 | void draw_start(); |
nasiromar | 10:e18685911e84 | 49 | |
rconnorlawson | 0:35660d7952f7 | 50 | void draw_border(); |
rconnorlawson | 0:35660d7952f7 | 51 | |
nasiromar | 7:862062ffca62 | 52 | void draw_gameover(); |
nasiromar | 7:862062ffca62 | 53 | |
nasiromar | 6:c9695079521d | 54 | void draw_npc(int u, int v); |
nasiromar | 6:c9695079521d | 55 | |
nasiromar | 6:c9695079521d | 56 | void draw_chest(int u , int v); |
nasiromar | 6:c9695079521d | 57 | |
nasiromar | 6:c9695079521d | 58 | void draw_castle(int u, int v); |
nasiromar | 6:c9695079521d | 59 | |
nasiromar | 7:862062ffca62 | 60 | void draw_kindom(int u, int v); |
nasiromar | 7:862062ffca62 | 61 | |
nasiromar | 6:c9695079521d | 62 | void draw_portal(int u, int v); |
nasiromar | 6:c9695079521d | 63 | |
nasiromar | 7:862062ffca62 | 64 | void draw_door(int u, int v); |
nasiromar | 7:862062ffca62 | 65 | |
nasiromar | 7:862062ffca62 | 66 | void draw_dragon(int u, int v); |
nasiromar | 7:862062ffca62 | 67 | |
nasiromar | 7:862062ffca62 | 68 | void draw_portal2(int u, int v); |
nasiromar | 7:862062ffca62 | 69 | |
nasiromar | 6:c9695079521d | 70 | |
rconnorlawson | 0:35660d7952f7 | 71 | #endif // GRAPHICS_H |