I somehow completely forgot this even though I did it just a few months ago. Don’t worry I have researched this however I haven’t found anything that seems to relate to what I want to do.
What I need to do is read an image to load a map. Let’s say it’s a 15x15 image:
1 = black
0 = white
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 1 1 1 1 1 1 1 1 1 1 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
0 1 1 1 1 1 1 1 1 1 1 1 1 0 0
0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 1 1 1 1 1 1 1 1 1 1 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
This would be used to load a simple 2d map into my game. How would I read this image and determine if the pixels are red/white/black? I’m sure I could use a buffered image and it’s raster but I don’t quite know how to read the raster.
On a nice little side note I did my Ordeal for Boy Scouts Order of the Arrow this weekend (if any of you know what that is
).
Thanks,
-cMp