Map
Map.h@2:2729d17161f4, 2017-05-03 (annotated)
- Committer:
- JackCripps
- Date:
- Wed May 03 12:53:41 2017 +0000
- Revision:
- 2:2729d17161f4
- Parent:
- 1:afa730298a2b
- Child:
- 3:1618532c9a2c
Map renders correctpy in both tile map and background
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
JackCripps | 0:1d3957b7699a | 1 | #ifndef MAP_H |
JackCripps | 0:1d3957b7699a | 2 | #define MAP_H |
JackCripps | 0:1d3957b7699a | 3 | |
JackCripps | 0:1d3957b7699a | 4 | #include "Bitmap.h" |
JackCripps | 0:1d3957b7699a | 5 | #include "N5110.h" |
JackCripps | 1:afa730298a2b | 6 | #include "GameObject.h" |
JackCripps | 0:1d3957b7699a | 7 | |
JackCripps | 1:afa730298a2b | 8 | // Tile size |
JackCripps | 0:1d3957b7699a | 9 | static const int tileSize = 4; |
JackCripps | 0:1d3957b7699a | 10 | |
JackCripps | 1:afa730298a2b | 11 | // The tile image |
JackCripps | 0:1d3957b7699a | 12 | static const int tileImage[] = { |
JackCripps | 0:1d3957b7699a | 13 | 1,1,1,1, |
JackCripps | 0:1d3957b7699a | 14 | 1,0,0,1, |
JackCripps | 0:1d3957b7699a | 15 | 1,0,0,1, |
JackCripps | 0:1d3957b7699a | 16 | 1,1,1,1 |
JackCripps | 0:1d3957b7699a | 17 | }; |
JackCripps | 0:1d3957b7699a | 18 | |
JackCripps | 1:afa730298a2b | 19 | // The tile map |
JackCripps | 0:1d3957b7699a | 20 | static const int tileMap[] = { |
JackCripps | 0:1d3957b7699a | 21 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
JackCripps | 0:1d3957b7699a | 22 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
JackCripps | 0:1d3957b7699a | 23 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
JackCripps | 0:1d3957b7699a | 24 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
JackCripps | 0:1d3957b7699a | 25 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
JackCripps | 0:1d3957b7699a | 26 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
JackCripps | 0:1d3957b7699a | 27 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
JackCripps | 1:afa730298a2b | 28 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1, |
JackCripps | 1:afa730298a2b | 29 | 0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0, |
JackCripps | 1:afa730298a2b | 30 | 0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
JackCripps | 0:1d3957b7699a | 31 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
JackCripps | 0:1d3957b7699a | 32 | 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 |
JackCripps | 0:1d3957b7699a | 33 | }; |
JackCripps | 0:1d3957b7699a | 34 | |
JackCripps | 1:afa730298a2b | 35 | // The level background |
JackCripps | 1:afa730298a2b | 36 | static const int levelBackground[] = { |
JackCripps | 1:afa730298a2b | 37 | 1,0,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,1,1,0,0,0,0,1,0,0,1,0,1,0,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, |
JackCripps | 1:afa730298a2b | 38 | 0,1,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,1,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1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, |
JackCripps | 1:afa730298a2b | 82 | 1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1, |
JackCripps | 1:afa730298a2b | 83 | 1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1, |
JackCripps | 1:afa730298a2b | 84 | 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 |
JackCripps | 1:afa730298a2b | 85 | }; |
JackCripps | 1:afa730298a2b | 86 | |
JackCripps | 0:1d3957b7699a | 87 | |
JackCripps | 0:1d3957b7699a | 88 | // https://developer.mozilla.org/en-US/docs/Games/Techniques/Tilemaps/Square_tilemaps_implementation%3A_Static_maps |
JackCripps | 1:afa730298a2b | 89 | /** Map Class |
JackCripps | 1:afa730298a2b | 90 | * |
JackCripps | 1:afa730298a2b | 91 | * Class stores the tile map and has functions for rendering it onto the screen |
JackCripps | 1:afa730298a2b | 92 | * and returning value of tile when given a coloumn and row |
JackCripps | 1:afa730298a2b | 93 | */ |
JackCripps | 0:1d3957b7699a | 94 | class Map |
JackCripps | 0:1d3957b7699a | 95 | { |
JackCripps | 0:1d3957b7699a | 96 | public: |
JackCripps | 1:afa730298a2b | 97 | /** Constructor */ |
JackCripps | 0:1d3957b7699a | 98 | Map(); |
JackCripps | 1:afa730298a2b | 99 | |
JackCripps | 1:afa730298a2b | 100 | /** Destructor */ |
JackCripps | 0:1d3957b7699a | 101 | ~Map(); |
JackCripps | 1:afa730298a2b | 102 | |
JackCripps | 1:afa730298a2b | 103 | /** Draw |
JackCripps | 1:afa730298a2b | 104 | * Draws the tilemap to the passed in lcd |
JackCripps | 1:afa730298a2b | 105 | * |
JackCripps | 1:afa730298a2b | 106 | * @param lcd Reference to the lcd object |
JackCripps | 1:afa730298a2b | 107 | */ |
JackCripps | 0:1d3957b7699a | 108 | void draw(N5110& lcd); |
JackCripps | 1:afa730298a2b | 109 | |
JackCripps | 1:afa730298a2b | 110 | /** |
JackCripps | 1:afa730298a2b | 111 | * Gets tile stored using row-major indexing |
JackCripps | 1:afa730298a2b | 112 | * |
JackCripps | 1:afa730298a2b | 113 | * @param col The coloumn in the tile map |
JackCripps | 1:afa730298a2b | 114 | * @param row The row in the tile map |
JackCripps | 1:afa730298a2b | 115 | * |
JackCripps | 1:afa730298a2b | 116 | * @returns The value of the tile at the index specified by the passed in |
JackCripps | 1:afa730298a2b | 117 | * row and coloumn. (1 if solid, 0 if not solid) |
JackCripps | 1:afa730298a2b | 118 | */ |
JackCripps | 0:1d3957b7699a | 119 | int getTile(int col, int row); |
JackCripps | 1:afa730298a2b | 120 | |
JackCripps | 1:afa730298a2b | 121 | /** |
JackCripps | 1:afa730298a2b | 122 | * Getter for maximum coloumn number |
JackCripps | 1:afa730298a2b | 123 | * |
JackCripps | 1:afa730298a2b | 124 | * @returns Last coloumn number of the tile map |
JackCripps | 1:afa730298a2b | 125 | */ |
JackCripps | 1:afa730298a2b | 126 | int getMaxCol(); |
JackCripps | 1:afa730298a2b | 127 | |
JackCripps | 1:afa730298a2b | 128 | /** |
JackCripps | 1:afa730298a2b | 129 | * Getter for maximum row number |
JackCripps | 1:afa730298a2b | 130 | * |
JackCripps | 1:afa730298a2b | 131 | * @returns The last row number of the tile map |
JackCripps | 1:afa730298a2b | 132 | */ |
JackCripps | 1:afa730298a2b | 133 | int getMaxRow(); |
JackCripps | 2:2729d17161f4 | 134 | |
JackCripps | 2:2729d17161f4 | 135 | /** |
JackCripps | 2:2729d17161f4 | 136 | * Getter for tile size |
JackCripps | 2:2729d17161f4 | 137 | * |
JackCripps | 2:2729d17161f4 | 138 | * @returns Tile size in pixels |
JackCripps | 2:2729d17161f4 | 139 | */ |
JackCripps | 2:2729d17161f4 | 140 | int getTileSize(); |
JackCripps | 0:1d3957b7699a | 141 | |
JackCripps | 0:1d3957b7699a | 142 | protected: |
JackCripps | 0:1d3957b7699a | 143 | |
JackCripps | 0:1d3957b7699a | 144 | |
JackCripps | 0:1d3957b7699a | 145 | private: |
JackCripps | 1:afa730298a2b | 146 | // Bitmap object storing tile image |
JackCripps | 0:1d3957b7699a | 147 | Bitmap _tileImageBitmap; |
JackCripps | 1:afa730298a2b | 148 | // Bitmap object storing the background |
JackCripps | 1:afa730298a2b | 149 | Bitmap _levelBackground; |
JackCripps | 0:1d3957b7699a | 150 | int _cols; |
JackCripps | 0:1d3957b7699a | 151 | int _rows; |
JackCripps | 0:1d3957b7699a | 152 | |
JackCripps | 0:1d3957b7699a | 153 | }; |
JackCripps | 0:1d3957b7699a | 154 | |
JackCripps | 0:1d3957b7699a | 155 | #endif |