This one is pretty open-ended since I'll be building the whole game to work around the system I create here, but I want to have levels where each 32x32 tile is generated from the color of one pixel in the corresponding position in an image file, likely a .bmp.
The game I am working on is a auto-scrolling 2D space shooter. The trick I'm going for here is that the whole game takes place in one room in GM with a static view, with objects and backgrounds all moving at a constant speed toward the left of the screen. As you progress through the level, it loads scenery and objects just offscreen to the right, and once something passes off the screen on the left it's deleted.
Because of this, I need a good visual way to make levels. Hence the image-based levels. Doing this would allow me to easily adjust level length, contents and more in whatever image program I choose to use, and store that data in fairly small file sizes. I can specify what each color means, and for each different level type I would have a script that reads every pixel and generates objects based on their color.
I think the best way to do this would be to have a script read each pixel horizontally like you would read text: left to right, top to bottom. That script would generate a text file as it goes, placing letters and symbols to correspond to the color.
That's as far as I get, because I couldn't find a function in GM to check for the color of an individual pixel. Is there any way to do this, even if it requires drawing the bitmap on the screen and reading from that? I found a couple threads using the search function, but they were both half a decade old, and they weren't much help.
One last thing, I'm building this game for iOS and Android, which means using Game Maker Studio, so .DLLs won't be any use here.
Edited by Dreamsequence, 24 May 2012 - 05:16 AM.











