First, forget all the fancy gui and start with basic different colored boxes(just to make things simple) get the basics of the engine done first then work on graphics and menus.
So to do this here is a kinda step by step approach
1 figure out your tile size. above it looks around 32x32 tiles
2. figure out your map width and height in tiles. in the screen above it's 8x8
3. create a array to store what type of diamond it is. you could make a struct like this:
struct MAP_TILE{
int image; // image number
int diamondType;
};
4. Create a 2d array of either an integer(just to store diamond type) or of your MAP_TILE structure.
5. find which tile the mouse is in. this is simple. just take it like this:
mx = mouse x - map screen offset x
my = mouse y - map screen offset y
tilex = mx / tile size
tiley = my / tile size
6. check surrounding tiles and do your stuff from there!
New Site! Check it out \/