Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-29-2008, 02:28 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Blocking Map Detection

I'm wanting to make some blocking detection for a side scroller idea of mine but since I am not using Graal levels I can't use onwall2 functions and such. My idea to implement it would be to have "blocking" image maps much like the attached images. Basically I would use pixel checks to see if the areas around you are blocking or not on the blocking map but the actual blocking map would be hidden or overlayed by actual graphic images. In this example, black would mean blocking and white would be passable.

This would work fairly well except I would need to check quite a large amount of pixels for very large objects. For this reason I have a feature request to make:

PHP Code:
hasimagepixel(rgbfilexywh) - returns boolean, if the pixel was found or not

Arguments
:
red value of the pixel to find
green value of the pixel to find
blue value of the pixel to find
file 
filename of image to pixel search
x value of upper left corner of area to search
y value of upper left corner of area to search
width is area to search
height of area to search 
It's pretty self explanatory; the function searches an image to see if the pixel pixel exists in the box. If at least 1 pixel matching that rgb is found, it returns true, otherwise it returns false.

The red dot in the image attached would actually be in the map, it's just to show you where the character might be. In that case he would need to stop upon hitting the blackness below him.

This could be useful for adding other things too since more then just 2 pixels could be in any given map.
__________________
Do it with a DON!
Reply With Quote
  #2  
Old 06-29-2008, 10:25 AM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
...! I really like this idea, that would be quite useful. I can think of at least two other ways I could use this for without mentioning side scrollers ;P
/sign
__________________
Reply With Quote
  #3  
Old 06-30-2008, 01:16 AM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
This doesn't need explanation on why it should be added,
/sign
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #4  
Old 06-30-2008, 03:47 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Well, explanations are always helpful!
__________________
Do it with a DON!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 02:12 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.