Map

Map.h

Committer:
JackCripps
Date:
2017-04-25
Revision:
0:1d3957b7699a
Child:
1:afa730298a2b

File content as of revision 0:1d3957b7699a:

#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