Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed wave_player 4DGL-uLCD-SE MMA8452
graphics.h
- Committer:
- ranroun3
- Date:
- 2021-12-01
- Revision:
- 21:9c414fbf4a6f
- Parent:
- 20:762297435411
- Child:
- 22:397601b1cdb4
File content as of revision 21:9c414fbf4a6f:
#ifndef GRAPHICS_H
#define GRAPHICS_H
//#include "map.h"
/**
* Draws the player. This depends on the player state, so it is not a DrawFunc.
*/
void draw_player(int u, int v, int key);
/**
* Takes a string image and draws it to the screen. The string is 121 characters
* long, and represents an 11x11 tile in row-major ordering (across, then down,
* like a regular multi-dimensional array). The available colors are:
* R = Red
* Y = Yellow
* G = Green
* D = Brown ("dirt")
* 5 = Light grey (50%)
* 3 = Dark grey (30%)
* Any other character is black
* More colors can be easily added by following the pattern already given.
*/
void draw_img(int u, int v, const char* img);
/**
* DrawFunc functions.
* These can be used as the MapItem draw functions.
*/
void draw_nothing(int u, int v);
void draw_wall(int u, int v);
void draw_plant(int u, int v);
void draw_stairs(int u, int v);
void draw_npc(int u, int v);
void draw_boss(int u, int v);
void draw_dead(int u, int v);
void draw_water(int u, int v);
void draw_fire(int u, int v);
void draw_taco(int u, int v);
void draw_red(int u, int v);
void draw_blue(int u , int v);
void draw_door(int u, int v);
void draw_treasure(int u, int v);
void draw_hammer(int u, int v);
void draw_healthPotion(int u, int v);
void draw_heart(int u, int v);
/**
* Draw the upper status bar.
EDIT: I edited this header to accept player x and y coordinates
*/
void draw_upper_status(int currX, int currY, int health, int lives);
/**
* Draw the lower status bar.
*/
void draw_lower_status(int item, int potion1, int potion2, bool firstDraw);
/**
* Draw the border for the map.
*/
void draw_border();
#endif // GRAPHICS_H