baseline features - a little buggy

Dependencies:   mbed wave_player 4DGL-uLCD-SE MMA8452

Committer:
DCchico
Date:
Mon Mar 29 21:17:26 2021 -0400
Revision:
0:95264f964374
Child:
1:4421c1e849e9
inital commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
DCchico 0:95264f964374 1 #ifndef GRAPHICS_H
DCchico 0:95264f964374 2 #define GRAPHICS_H
DCchico 0:95264f964374 3 #include "globals.h"
DCchico 0:95264f964374 4
DCchico 0:95264f964374 5 // TODO: Determine X and Y Ranges
DCchico 0:95264f964374 6 #define SIZE_X 127
DCchico 0:95264f964374 7 #define SIZE_Y 127
DCchico 0:95264f964374 8
DCchico 0:95264f964374 9 // The bottom of the screen => y=127
DCchico 0:95264f964374 10 // lets the compost piles grow up from the bottom of the screen. It is awkward.
DCchico 0:95264f964374 11 // Thus, we use a macro to reverse the coordinate for convenience.
DCchico 0:95264f964374 12 #define REVERSE_Y(x) (SIZE_Y-(x))
DCchico 0:95264f964374 13
DCchico 0:95264f964374 14 /**
DCchico 0:95264f964374 15 * Draws the player. This depends on the player state, so it is not a DrawFunc.
DCchico 0:95264f964374 16 */
DCchico 0:95264f964374 17 void draw_player(int u, int v, int key);
DCchico 0:95264f964374 18
DCchico 0:95264f964374 19 /**
DCchico 0:95264f964374 20 * Takes a string image and draws it to the screen. The string is 121 characters
DCchico 0:95264f964374 21 * long, and represents an 11x11 tile in row-major ordering (across, then down,
DCchico 0:95264f964374 22 * like a regular multi-dimensional array). The available colors are:
DCchico 0:95264f964374 23 * R = Red
DCchico 0:95264f964374 24 * Y = Yellow
DCchico 0:95264f964374 25 * G = Green
DCchico 0:95264f964374 26 * D = Brown ("dirt")
DCchico 0:95264f964374 27 * 5 = Light grey (50%)
DCchico 0:95264f964374 28 * 3 = Dark grey (30%)
DCchico 0:95264f964374 29 * Any other character is black
DCchico 0:95264f964374 30 * More colors can be easily added by following the pattern already given.
DCchico 0:95264f964374 31 */
DCchico 0:95264f964374 32 void draw_img(int u, int v, const char* img);
DCchico 0:95264f964374 33
DCchico 0:95264f964374 34 /**
DCchico 0:95264f964374 35 * DrawFunc functions.
DCchico 0:95264f964374 36 * These can be used as the MapItem draw functions.
DCchico 0:95264f964374 37 */
DCchico 0:95264f964374 38 void draw_nothing(boundingBox b);
DCchico 0:95264f964374 39 void draw_bomb(boundingBox b);
DCchico 0:95264f964374 40 void draw_banana(boundingBox b);
DCchico 0:95264f964374 41 void draw_orange(boundingBox b);
DCchico 0:95264f964374 42
DCchico 0:95264f964374 43
DCchico 0:95264f964374 44 #endif // GRAPHICS_H