P2-2 Harris Barton
Dependencies: mbed wave_player 4DGL-uLCD-SE MMA8452
graphics.h@2:4947d6a82971, 2020-10-23 (annotated)
- Committer:
- DCchico
- Date:
- Fri Oct 23 16:30:18 2020 -0400
- Revision:
- 2:4947d6a82971
- Parent:
- 1:10330bce85cb
- Child:
- 3:e2fb359d6545
shell
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
DCchico | 2:4947d6a82971 | 1 | // Copyright 2020 Georgia Tech. All rights reserved. |
DCchico | 2:4947d6a82971 | 2 | // The materials provided by the instructor in this course are for |
DCchico | 2:4947d6a82971 | 3 | // the use of the students currently enrolled in the course. |
DCchico | 2:4947d6a82971 | 4 | // Copyrighted course materials may not be further disseminated. |
DCchico | 2:4947d6a82971 | 5 | // This file must not be made publicly available anywhere. |
DCchico | 2:4947d6a82971 | 6 | |
DCchico | 1:10330bce85cb | 7 | #ifndef GRAPHICS_H |
DCchico | 1:10330bce85cb | 8 | #define GRAPHICS_H |
DCchico | 1:10330bce85cb | 9 | |
DCchico | 1:10330bce85cb | 10 | /** |
DCchico | 1:10330bce85cb | 11 | * Takes a string image and draws it to the screen. The string is 121 characters |
DCchico | 1:10330bce85cb | 12 | * long, and represents an 11x11 tile in row-major ordering (across, then down, |
DCchico | 1:10330bce85cb | 13 | * like a regular multi-dimensional array). The available colors are: |
DCchico | 1:10330bce85cb | 14 | * R = Red |
DCchico | 1:10330bce85cb | 15 | * Y = Yellow |
DCchico | 1:10330bce85cb | 16 | * G = Green |
DCchico | 1:10330bce85cb | 17 | * D = Brown ("dirt") |
DCchico | 1:10330bce85cb | 18 | * 5 = Light grey (50%) |
DCchico | 1:10330bce85cb | 19 | * 3 = Dark grey (30%) |
DCchico | 1:10330bce85cb | 20 | * Any other character is black |
DCchico | 1:10330bce85cb | 21 | * More colors can be easily added by following the pattern already given. |
DCchico | 1:10330bce85cb | 22 | */ |
DCchico | 1:10330bce85cb | 23 | void draw_img(int u, int v, const char* img); |
DCchico | 1:10330bce85cb | 24 | |
DCchico | 1:10330bce85cb | 25 | /** |
DCchico | 1:10330bce85cb | 26 | * DrawFunc functions. |
DCchico | 1:10330bce85cb | 27 | * These can be used as the MapItem draw functions. |
DCchico | 1:10330bce85cb | 28 | */ |
DCchico | 1:10330bce85cb | 29 | |
DCchico | 1:10330bce85cb | 30 | void draw_nothing(int u, int v); |
DCchico | 1:10330bce85cb | 31 | void draw_plant(int u, int v); |
DCchico | 1:10330bce85cb | 32 | void draw_wall(int u, int v); |
DCchico | 1:10330bce85cb | 33 | void draw_goodie(int u, int v); |
DCchico | 1:10330bce85cb | 34 | void draw_snake_body(int u, int v); |
DCchico | 1:10330bce85cb | 35 | void draw_snake_head(int u, int v); |
DCchico | 1:10330bce85cb | 36 | void draw_snake_tail(int u, int v); |
DCchico | 1:10330bce85cb | 37 | |
DCchico | 1:10330bce85cb | 38 | |
DCchico | 1:10330bce85cb | 39 | #endif // GRAPHICS_H |