mirror of
https://github.com/dylanbenzi/pacmen-sfml.git
synced 2026-11-27 08:26:59 +00:00
modify map loading
This commit is contained in:
@@ -14,14 +14,6 @@
|
|||||||
|
|
||||||
using json = nlohmann::json;
|
using json = nlohmann::json;
|
||||||
|
|
||||||
struct TileMapData {
|
|
||||||
std::vector<int> tiles;
|
|
||||||
unsigned int width;
|
|
||||||
unsigned int height;
|
|
||||||
unsigned int tileSize;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class TileMap : public sf::Drawable, public sf::Transformable {
|
class TileMap : public sf::Drawable, public sf::Transformable {
|
||||||
public:
|
public:
|
||||||
std::vector<int> tiles;
|
std::vector<int> tiles;
|
||||||
|
|||||||
+3
-3
@@ -22,8 +22,8 @@ int main()
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
TileMap map;
|
//TileMap map;
|
||||||
if (!map.load("assets/maze32.png",
|
if (!mazeMap.load("assets/maze32.png",
|
||||||
{mazeMap.tileSize, mazeMap.tileSize},
|
{mazeMap.tileSize, mazeMap.tileSize},
|
||||||
mazeMap.tiles.data(),
|
mazeMap.tiles.data(),
|
||||||
mazeMap.width,
|
mazeMap.width,
|
||||||
@@ -105,7 +105,7 @@ int main()
|
|||||||
|
|
||||||
window.clear();
|
window.clear();
|
||||||
|
|
||||||
window.draw(map);
|
window.draw(mazeMap);
|
||||||
window.draw(currTile);
|
window.draw(currTile);
|
||||||
window.draw(tileX);
|
window.draw(tileX);
|
||||||
window.draw(tileY);
|
window.draw(tileY);
|
||||||
|
|||||||
Reference in New Issue
Block a user