Snake

Dependencies:   mbed wave_player 4DGL-uLCD-SE MMA8452

Committer:
DCchico
Date:
Fri Oct 23 16:18:39 2020 -0400
Revision:
1:10330bce85cb
Child:
2:4947d6a82971
shell-code

Who changed what in which revision?

UserRevisionLine numberNew contents of line
DCchico 1:10330bce85cb 1 #ifndef GRAPHICS_H
DCchico 1:10330bce85cb 2 #define GRAPHICS_H
DCchico 1:10330bce85cb 3
DCchico 1:10330bce85cb 4 /**
DCchico 1:10330bce85cb 5 * Takes a string image and draws it to the screen. The string is 121 characters
DCchico 1:10330bce85cb 6 * long, and represents an 11x11 tile in row-major ordering (across, then down,
DCchico 1:10330bce85cb 7 * like a regular multi-dimensional array). The available colors are:
DCchico 1:10330bce85cb 8 * R = Red
DCchico 1:10330bce85cb 9 * Y = Yellow
DCchico 1:10330bce85cb 10 * G = Green
DCchico 1:10330bce85cb 11 * D = Brown ("dirt")
DCchico 1:10330bce85cb 12 * 5 = Light grey (50%)
DCchico 1:10330bce85cb 13 * 3 = Dark grey (30%)
DCchico 1:10330bce85cb 14 * Any other character is black
DCchico 1:10330bce85cb 15 * More colors can be easily added by following the pattern already given.
DCchico 1:10330bce85cb 16 */
DCchico 1:10330bce85cb 17 void draw_img(int u, int v, const char* img);
DCchico 1:10330bce85cb 18
DCchico 1:10330bce85cb 19 /**
DCchico 1:10330bce85cb 20 * DrawFunc functions.
DCchico 1:10330bce85cb 21 * These can be used as the MapItem draw functions.
DCchico 1:10330bce85cb 22 */
DCchico 1:10330bce85cb 23
DCchico 1:10330bce85cb 24 void draw_nothing(int u, int v);
DCchico 1:10330bce85cb 25 void draw_plant(int u, int v);
DCchico 1:10330bce85cb 26 void draw_wall(int u, int v);
DCchico 1:10330bce85cb 27 void draw_goodie(int u, int v);
DCchico 1:10330bce85cb 28 void draw_snake_body(int u, int v);
DCchico 1:10330bce85cb 29 void draw_snake_head(int u, int v);
DCchico 1:10330bce85cb 30 void draw_snake_tail(int u, int v);
DCchico 1:10330bce85cb 31
DCchico 1:10330bce85cb 32
DCchico 1:10330bce85cb 33 #endif // GRAPHICS_H