fastismatt
Lurker
Hey all,
I'm designing a 2D sidescroller-style game and I'm trying to figure out the easiest way to design a map. Right now my plan is to have two layers for the map, one invisible and one visible. The visible one will simply be painted into the background, and the invisible one will not actually be painted. The invisible one I plan to have as an array of numbers where each cell corresponds to a tile in the landscape. How the player interacts with the landscape at that tile depends on the value held in the cell.
Now I just need to figure out an easy way to import values for this array which may be thousands of columns long. My plan right now is to create a grayscale image where each shade of gray corresponds to a different type of surface, and then to import this image as a bitmap. However, I can't find a way to turn the bitmap into an array. Is there an easy way to do this or a tutorial anywhere I can read?
Or does anyone have a better approach to this problem?
Thank you,
Matt
I'm designing a 2D sidescroller-style game and I'm trying to figure out the easiest way to design a map. Right now my plan is to have two layers for the map, one invisible and one visible. The visible one will simply be painted into the background, and the invisible one will not actually be painted. The invisible one I plan to have as an array of numbers where each cell corresponds to a tile in the landscape. How the player interacts with the landscape at that tile depends on the value held in the cell.
Now I just need to figure out an easy way to import values for this array which may be thousands of columns long. My plan right now is to create a grayscale image where each shade of gray corresponds to a different type of surface, and then to import this image as a bitmap. However, I can't find a way to turn the bitmap into an array. Is there an easy way to do this or a tutorial anywhere I can read?
Or does anyone have a better approach to this problem?
Thank you,
Matt