Robbie Huey / Mbed 2 deprecated baseline

Dependencies:   mbed wave_player 4DGL-uLCD-SE MMA8452

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers graphics.h Source File

graphics.h

00001 #ifndef GRAPHICS_H
00002 #define GRAPHICS_H
00003 #include "globals.h"
00004  
00005 // TODO: Determine X and Y Ranges
00006 #define SIZE_X 127
00007 #define SIZE_Y 127
00008 
00009 // The bottom of the screen => y=127
00010 // lets the compost piles grow up from the bottom of the screen. It is awkward.
00011 // Thus, we use a macro to reverse the coordinate for convenience.
00012 #define REVERSE_Y(x) (SIZE_Y-(x))
00013 
00014 /**
00015  * Draws the player. This depends on the player state, so it is not a DrawFunc.
00016  */
00017 void draw_player(int u, int v, int key);
00018  
00019 /**
00020  * Takes a string image and draws it to the screen. The string is 121 characters
00021  * long, and represents an 11x11 tile in row-major ordering (across, then down,
00022  * like a regular multi-dimensional array). The available colors are:
00023  *      R = Red
00024  *      Y = Yellow
00025  *      G = Green
00026  *      D = Brown ("dirt")
00027  *      5 = Light grey (50%)
00028  *      3 = Dark grey (30%)
00029  *      Any other character is black
00030  * More colors can be easily added by following the pattern already given.
00031  */
00032 void draw_img(int u, int v, const char* img);
00033 
00034 /**
00035  * DrawFunc functions.
00036  * These can be used as the MapItem draw functions.
00037  */
00038 void draw_start();
00039 void draw_nothing(boundingBox b);
00040 void draw_bomb(boundingBox b);
00041 void draw_banana(boundingBox b);
00042 void draw_orange(boundingBox b);
00043 
00044  
00045 #endif // GRAPHICS_H