mirror of
https://github.com/dylanbenzi/pacmen-sfml.git
synced 2026-11-27 00:17:01 +00:00
modify map loading
This commit is contained in:
@@ -14,14 +14,6 @@
|
||||
|
||||
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 {
|
||||
public:
|
||||
std::vector<int> tiles;
|
||||
|
||||
+3
-3
@@ -22,8 +22,8 @@ int main()
|
||||
return -1;
|
||||
}
|
||||
|
||||
TileMap map;
|
||||
if (!map.load("assets/maze32.png",
|
||||
//TileMap map;
|
||||
if (!mazeMap.load("assets/maze32.png",
|
||||
{mazeMap.tileSize, mazeMap.tileSize},
|
||||
mazeMap.tiles.data(),
|
||||
mazeMap.width,
|
||||
@@ -105,7 +105,7 @@ int main()
|
||||
|
||||
window.clear();
|
||||
|
||||
window.draw(map);
|
||||
window.draw(mazeMap);
|
||||
window.draw(currTile);
|
||||
window.draw(tileX);
|
||||
window.draw(tileY);
|
||||
|
||||
Reference in New Issue
Block a user