ok ,
first.
you need a Tile method or a Tile Engine for all the tiles
like Grass / Dirt / Road and even Walls and Castles etc.. all of the map should be on a Tile Map Engine , now i never finished mine
but the idea of it is to do an Array like this:
int Tiles[1000,1000] = {0}
int Tiles [X,Y] x,y positions on the 2D screen.
this will hold all the Tile Data in each Position on the Tile Map
/////////////////////////////////////////////////////////////////
now you need one more Array for what you actually See in the game while playing according to your Player Position as you dont see the entire map just the area you are in
so :
why 50? , well depends on how you want your game to look , you can go from 10 tiles to 100 to 1000 tiles on screen, but this may take a lot of CPU power to calculate, and it depends on how far you want to look at your player.
simple level example:
1 = Dirt
2 = Grass
3 = Trees
4 = Water Tile
5 = House (Bigger then other Tiles but still represents as the Center Tile and later i will explain on how to implent it on some tiles like 4 x 4 tiles or 10 x 10 )
so lets say you have the first map
Level One (or Starting Area) which are good for Tutorial on how to play the game , or like Pokemon where you wake up in your bed and walk out the house.. well , this is where the Story Begins)
so , we have our first Array :
now we implent the numbers we want on the Entire First Map
Tiles[1000,1000] = {1,1,1,1,1,1,1,1,1,1,1...etc...
1,1,1,1,2,,2,2,2,2,2,2,2...
1,1,1,2,2,2,2,2,2,2,2,2,2,
1,1,2,2,2,2,2,2,2,1,1,1,2,2,1,2,2,1,
}//1000 width X , and 1000 height Y
*** dont trust this code as i didnt coded for a long time
****
so you can see , that the Tiles for this level is mostly Dirt and Grass, that was a rud example
check this one , will be easier just putting 10 X and 10 Y to the entire Level
Tiles[10,10] = {1,2,2,2,2,2,2,2,2,1,
1,2,2,2,3,3,3,2,3,3,
1,1,1,2,3,3,3,3,2,3,
1,1,2,2,2,2,4,4,4,4,
/*house(5)>*/1,2,2,5,2,2,4,4,4,4,
1,2,2,2,2,2,4,4,2,3,
2,2,2,2,2,2,4,4,4,3,
2,3,3,3,2,4,4,4,3,3,
2,3,3,2,2,4,4,4,2,3,
3,3,3,3,3,2,2,4,4,4}
ok , you can see here , you have some Dirt and some Grass some Trees even a Lake(water Tiles) and a house.
this is just a level example.
in DarkGdk , you load the Images for the Tiles in a way that
dbLoadImage("images\\Dirt.bmp",1); // Dirt Tile
dbLoadImage("images\\Grass.bmp",2); // Grass Tile
dbLoadImage("images\\Trees.bmp",3); // Trees Tile
dbLoadImage("images\\Water.bmp",4); // Water Tile
dbLoadImage("images\\House.bmp",5); // House Tile
and you load up it into Sprites , each tile is a diffrent Sprite
you have 10 x on a 10 y array
so you will need to :
dbSprite(TileNum,Xposition,Yposition,TileImage);
TileNum = represents the ID number of that current Sprite
Xposition = the X position on Screen for where the Sprite\Tile place on the X axis.
Yposition = same as the X only on the Y axis.
TileImage = represents the Data or Image of what Tile Image to use in that Sprite.
the most Simple way to implent the Tiles[10,10] Array in Sprites is, using a Loop to implent each and everyone of the Sprites \ Tiles:
int TileNum = 1; //Represents Tile ID in Sprites
for (int y=0;y < 11;y++)
{
for (int x=0;x < 11; x++)
{
dbSprite(TileNum,x * WidthOfTile,y*HeightofTile,Tile[x,y]);
}
}
after this is done , you have all the Tiles setup in Sprites and you will see your map exactly as you arranged them before in the Tiles Array.
ok , this is it for now, you will have to look more and more on the Web , just search for Tile Based Engines or 2D Tiles Programming in C++ or even in DarkGDK you might Find something.
you can also look at the CodeBase under Community button on the menubar and search for it in DarkBasicPro or similar , the code is very much alike but there are somechanges as this is C++ and thats C#.
im sorry if i under estamate your programming knwoledge
its all with good feeling.
hope this can help , this will give you a push .
and a note to other viewers if you have better ways then please share with us and fix me if im wrong.