|
Color collision |
miguel meza
Member #5,447
January 2005
|
Hi,well, in 2d fitghing game (dragon ball), when the player does a "special power" i use animated gif. And they have transparent parts. I want to the collision detection something like this: if (the color of the player1.posX+player1.width is not transparent) any ideas? |
OICW
Member #4,069
November 2003
|
Pixel perfect collisions... [My website][CppReference][Pixelate][Allegators worldwide][Who's online] |
miguel meza
Member #5,447
January 2005
|
that is good, but it doesnt works perfeclty for what i want... isnt there a way to do what i want? |
Fladimir da Gorf
Member #1,565
October 2001
|
What do you want? If you need to read only one pixel from a player's bitmap, then use getpixel with a correct offset. OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori) |
miguel meza
Member #5,447
January 2005
|
i only need to know i a pixel in a certain position is transparent or not...... |
SonShadowCat
Member #1,548
September 2001
|
if using something other than 8bit, you do( not 100% sure on what transparent color is): if( _getpixel( whatever pixel) == makecol( 255, 255, 0)) If its 8bit then replace makecol( ...) with 0 I think. I may be wrong. |
miguel meza
Member #5,447
January 2005
|
thanks you, that was what i wanted...... |
Fladimir da Gorf
Member #1,565
October 2001
|
OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori) |
|