Ok so my game is coming along nicely and I'm at the point were I want to make an effective way of creating maps.
I know there is the read from a text file or section of code way that could have a bunch of numbers and/or letters to represent different tiles that I currently have loaded from a sprite sheet.
0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0,
1, 1, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3,
0, 1, 0, 0, 2, 0, 3, 3, 3, 0, 1, 1, 1, 0, 0, 0,
0, 1, 1, 0, 3, 3, 3, 0, 0, 0, 1, 1, 1, 2, 0, 0,
0, 0, 1, 0, 3, 0, 2, 2, 0, 0, 1, 1, 1, 1, 2, 0,
2, 0, 1, 0, 3, 0, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1,
0, 0, 1, 0, 3, 2, 2, 2, 0, 0, 0, 0, 1, 1, 1, 1,
But that is visually unappealing and cumbersome to work with if I or a team member wanted to alter/create a map.
Is there a way of loading an image file and checking each pixel of that image line by line and fill in my array of tiles based on the colour value of each pixel?
Example
I want it to be able to read and identify the color of each pixel and draw a tile based on what the colour code is. I.e. if colour = #bb00bb then draw water, etc.
Does SFML have anything that might help with this? Anyone know of any good methods of approaching this or know of someone else who has implemented this?