Original Post
Hi guys,
I am using a simple program called 'd2d map editor' which basically draws your tiles and sorts out collition then genarates some code for it.
The problem im having is how to actually make it work? below is the code it genarates:
But dont know what I would but in the load, draw/updates methods to get this code to actually work in xna?
I am using a simple program called 'd2d map editor' which basically draws your tiles and sorts out collition then genarates some code for it.
The problem im having is how to actually make it work? below is the code it genarates:
// This C++ code is generated by D2D Map Editor
// Tile
struct tile
{
int id;
string name;
bool walkable;
string path;
};
tile myTiles[10];
myTiles[0].id = 0;
myTiles[0].name = "0";
myTiles[0].walkable = false;
myTiles[0].path = "Untitled\000.bmp";
myTiles[1].id = 1;
myTiles[1].name = "1";
myTiles[1].walkable = false;
myTiles[1].path = "Untitled\001.bmp";
myTiles[2].id = 2;
myTiles[2].name = "2";
myTiles[2].walkable = false;
myTiles[2].path = "Untitled\002.bmp";
myTiles[3].id = 3;
myTiles[3].name = "3";
myTiles[3].walkable = false;
myTiles[3].path = "Untitled\003.bmp";
myTiles[4].id = 4;
myTiles[4].name = "4";
myTiles[4].walkable = false;
myTiles[4].path = "Untitled\004.bmp";
myTiles[5].id = 5;
myTiles[5].name = "5";
myTiles[5].walkable = false;
myTiles[5].path = "Untitled\005.bmp";
myTiles[6].id = 6;
myTiles[6].name = "6";
myTiles[6].walkable = true;
myTiles[6].path = "Untitled\006.bmp";
myTiles[7].id = 7;
myTiles[7].name = "7";
myTiles[7].walkable = false;
myTiles[7].path = "Untitled\007.bmp";
myTiles[8].id = 8;
myTiles[8].name = "8";
myTiles[8].walkable = false;
myTiles[8].path = "Untitled\008.bmp";
myTiles[9].id = 9;
myTiles[9].name = "9";
myTiles[9].walkable = false;
myTiles[9].path = "Untitled\009.bmp";
// Map size
const int mapWidth = 25;
const int mapHeight = 15;
// Map alpha
int mapAlpha = 100;
// Map Array
int Layer1[mapWidth][mapHeight] = {
{ 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9},
{ 3, 6, 6,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