Brilliant Rich. This is very similar to our Statics mapping we used for our RPG demo project. The concept was in 3D, but basically the same. Where the player is on the 3D map (x & z) pointed to coordinates on an image map (x & y), and the resulting pixel colors told the code which objects to load for grass, sand, dirt, rocks, flowers, and so on. It was also used for sounds as the player "walked" on the various terrain types.
IMHO, Images hold a lot of data, and I believe that all that data is way under used. This is one more example of how image data can be used beyond just pretty pictures.
Anyway, I am ashamed that I did not think of this as an extension of statics. So, here is me playing around with it (image is the attachment). There are more things I want to do, but this is just a start.
Oh, and you might find the image-memblock functions useful. Saves having to swap bitmaps to pull the pixel.
REM Project: Screen Mapping
REM Created: 7/22/2009 11:59:59 PM
REM
REM ***** Main Source File *****
REM
Sync On:Sync Rate 60:Autocam Off
Load Image "ScreenMap.png",1,1
Make Memblock From Image 1,1
For i = 1 to 100
Make Object Cube i,1
Position Object i,Rnd(500)-250,-1,Rnd(500)-250
Next i
Do
Control_Camera()
Sync
Loop
Function Control_Camera()
If MouseClick()<>2 Then ExitFunction
iw#=Image Width(1):ih#=Image Height(1)
sw#=Screen Width():sh#=Screen Height()
scalex#=iw#/sw#
scaley#=ih#/sh#
x=MouseX()*scalex#
y=MouseY()*scaley#
ptr=Get_Pixel_Pos(x,y,1)
Color=Memblock DWord(1,ptr)
red#=RGBR(Color)
green#=RGBG(Color)
blue#=RGBB(Color)
If blue#>0
Turn Camera Left ((MouseX()<Screen Width()*.5)-(MouseX()>Screen Width()*.5))*(.005*blue#)
EndIf
If green#>0
Move Camera ((MouseY()<Screen Height()*.5)-(MouseY()>Screen Height()*.5))*(.002*green#)
EndIf
EndFunction
`===============================================================
`Image-Memblock Functions=======================================
`===============================================================
Function Memblock_Width(MemblockID)
If Memblock Exist(MemblockID)=0 then Exitfunction 0
If Get Memblock Size(MemblockID)<12 then exitfunction 0
w=Memblock Dword(MemblockID,0)
Endfunction w
Function Memblock_Height(MemblockID)
If Memblock Exist(MemblockID)=0 then Exitfunction 0
If Get Memblock Size(MemblockID)<12 then exitfunction 0
h=Memblock Dword(MemblockID,4)
Endfunction h
Function Memblock_Depth(MemblockID)
If Memblock Exist(MemblockID)=0 then Exitfunction 0
If Get Memblock Size(MemblockID)<12 then exitfunction 0
d=Memblock Dword(MemblockID,8)
Endfunction d
Function Get_Pixel_Pos(x,y,MemblockID)
p as dword
p=0
if Memblock Exist(MemblockID)=0 Then Exitfunction p
w=Memblock_Width(MemblockID)
h=Memblock_Height(MemblockID)
d=Memblock_Depth(MemblockID)
p=y*(w*(d/8))+x*(d/8)
_max as dword
_max = h*w*(d/8)
if p>Get Memblock Size(MemblockID)-1
p=Get Memblock Size(MemblockID)-1
endif
p=p+12
if p<12 then p=12
if p>Get Memblock Size(MemblockID)-5 Then p=Get Memblock Size(MemblockID)-5
Endfunction p

Open MMORPG: It's your game!