This is what is going on.
I am drawing a isometric tile map( that is some what the easy part).
Below is the code I use to make my tiles apera on the screen and able to scroll the map.
Void draw_tiles(void){ int z; for( z = 0; z<Layer;z++){ For( Tileset.y = 0;Tileset.y<MapY; Tileset.y++) { For( Tileset.x = 0;Tileset.x<MapX; Tileset.x++) { //for scrolling the tile map Tileset.offset_x=Tileset.world_camera_X+(ScreenX/2); Tileset.offset_y=Tileset.world_camera_Y+(ScreenY/2);//To assign tileset.tiles the tile ids found in the map fileTileset.tiles = map[z][Tileset.y][Tileset.x];//the tile_src code is to pick what tile it draws from the bitmapTile_src.left = ((Tileset.tiles)%20) * Tileset.Tile_Width;Tile_src.top = ((Tileset.tiles)/20) * Tileset.Tile_Hight;Tile_src.right = Tile_src.left + Tileset.Tile_Width;Tile_src.bottom = Tile_src.top + Tileset.Tile_Hight; // the dstr code is to pick were to draw the tiles on to the screen at and what order Dstr.left = ((Tileset.x – Tileset.y) * Tileset.Tile_Width/2 + Tileset.offset_x;Dstr.right = Dstr.left + Tileset.Tile_Width;Dstr.top = ((Tileset.x + Tileset.y) * Tileset.Tile_Hight/4 - Tileset.offset_y;Dstr.bottom = Dstr.top + Tileset.Tile_Hight;lpBackBuffer-> Blt(&Dstr, g_pddTile, &tile_src, DDBLT_WAIT|DDBLT_KEYSRC,NULL) } } }}
Just to lwt you know I am using windows XP, using dev cpp for the compiler and c++ for the laguage and also using directdraw for the gfx api
so what I am trying to figure out now is how to tell what freaken tile the mouse is over onece I figure out how to do that and how to tell what object the mouse is over(besides figureing out how to place the object on the map the very base of the map editor and tile egine will be done.
the tiles are 128x128 cells but the actuel tile is 128x64
there are 3 layers at the moment Layer 1 for all the base tilesLayer 2 for all the secondary base tiles(trees,rocks,naturel land marks)Layer 3 not used right now
what is making this so hard is because the map scrolls so it is bigger then the acruel screen.
I need to find out what the tile ID is unedernith the mouse and what the coords of the tile is to so I can replace it with a tile I have picked.
so that persents another issue. I need to figure out what layer the mouse is on also
My goal is to make the coolest most interactive RTS on the market and at the same time have a huge game compony publish it for me just like all these people who right books and have the book compony publish them
To do this I am making a tile game engine in directDraw to start then when I understand and make all the base concepts of an RTS then I am converting it to Direct3D but still use sprites and tiles because every game that was cool like roller coaster tycoon or age of empires and they turned it into a 3D game it became slow and did not look so detailed. So I am going to stick with 2d sprites so it looks 3D but there all prerendered.
I am in the prosses of making a 2D map/level editor that will be able to make any 2D game from break out to age of empiers 2 games and anything in between. So far I have made a sprite animation editor tool. and now I am trying to build a tile map editor but I am stuck on trying to get the mouse to see what tile it is over. I am also going to make a object properties editor and then a editor to attach sounds a sync them to the sprites and animations
more to come later on my way to making the coolest RTS game ever