Pen Collision

thebangzats

  • Posts: 4
Wow, ANYTHING on screen huh? Pretty powerful, AND the exact thing I need for what I'm working on, now I don't have to worry about separating lights in layers or something like that.

Also I think I understand your explanation about where it detects the color. Though the code,
Code: [Select]
_PixelColor = FlxG.buffer.getPixel32(actor.getX(), actor.getY());How do I add another pixel getter? Since you said if I'd need 2 sensors instead of just one.

Though I guess I could put it dead-center, maybe with the excuse of "guards won't chase you unless the spotlight confirms it's you, they won't go crazy after seeing a silhouette of a hand"

Thanks again :D

brantsmith

  • Posts: 151
Wow, ANYTHING on screen huh? Pretty powerful, AND the exact thing I need for what I'm working on, now I don't have to worry about separating lights in layers or something like that.

Also I think I understand your explanation about where it detects the color. Though the code,
Code: [Select]
_PixelColor = FlxG.buffer.getPixel32(actor.getX(), actor.getY());How do I add another pixel getter? Since you said if I'd need 2 sensors instead of just one.

Though I guess I could put it dead-center, maybe with the excuse of "guards won't chase you unless the spotlight confirms it's you, they won't go crazy after seeing a silhouette of a hand"

Thanks again :D

make another color variable, say name it PixelColor2. Then right underneath your above line, write.
Code: [Select]
_PixelColor2 = FlxG.buffer.getPixel32(actor.getX(), actor.getY());thats how you add. And then you would just do.
Code: [Select]
if (PixelColor2 = whatever) do something else. You get the idea.

Also, I dont know if you could put the pixel getter in the middle of the actor. It would just pick up the actors pixel color. (unless of course the white spotlight was on top of the actor.)

And yes, It is powerful. That was the whole idea in making this code. Was to be able to have a way to find out what color was where.
Coding is Awesome.
Stencyl is Better.