Map
Diff: Map.h
- Revision:
- 0:1d3957b7699a
- Child:
- 1:afa730298a2b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Map.h Tue Apr 25 12:22:48 2017 +0000 @@ -0,0 +1,51 @@ +#ifndef MAP_H +#define MAP_H + +#include "Bitmap.h" +#include "N5110.h" + +static const int tileSize = 4; + +static const int tileImage[] = { + 1,1,1,1, + 1,0,0,1, + 1,0,0,1, + 1,1,1,1 +}; + +static const int tileMap[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 +}; + + +// https://developer.mozilla.org/en-US/docs/Games/Techniques/Tilemaps/Square_tilemaps_implementation%3A_Static_maps +class Map +{ +public: + Map(); + ~Map(); + void draw(N5110& lcd); + int getTile(int col, int row); + +protected: + + +private: + Bitmap _tileImageBitmap; + int _cols; + int _rows; + +}; + +#endif \ No newline at end of file