News:

Function Finder  Find all the functions within source code files

Main Menu

SpriteCollisionDebugMode

Started by Tracy, February 07, 2006, 10:46:01 PM

Previous topic - Next topic

Tracy

Hi again all.

I was playing around with the SpritecollisiondebugMode command and seem to have found some sort of bug.

I plugged it into the '2D game example' that came with the demo playbasic version and got this same effect, and I'd be interested to see if it's just me or what.

I turned the debugmode on when I created the player sprite (for the player sprite), and found that the red box would leave the area that the sprite was displayed in (which shouldn't happen, if I understand the function correctly.) I also found that the collision box (white) wasn't accurrately giving me the collision area. That is to say, when I displayed the white collision box around my projectile(different game), I'd get collisions no matter if they overlapped the box or not as long as I'd centered the sprite handle on the projectile. If I don't center the sprite handle, the white box gives an accurate collision area..

My question is: what, exactly, are the white/red boxes indicative of and what are they based on? The collisions work (pretty much) as I intend them to, yet the debug mode displays something totally kookie. What am I missing?

Could else try it on the 2D game example and see if you get the same results I do? It seems to happen when the box is below or to the right of the starting coordinate, and will be pretty obvious if it occurs.

If not, I'll go ahead and paste the code I have of the 2D game demo. I have modified it very slightly (the box can fly now instead of jump) but I don't see how that would affect things. Thanks.

P.S. I apologize for my copious parentheses use. Bad literary habit.

P.P.S. I've included a snapshot of the issue. The projectile is my spiffy (well, not really) spinning mass of spears there. The red boxes for the spear can be seen to the bottom right of it, and the white (collision) box for the spear can be seen overlapping the box... which takes no damage. The rough starting position of the player sprite is marked with the 'X'. As you can see, the offset of the red boxes is linear with the starting point and the actual sprite position.

P.P.S. I ran the SpriteCollisionDebugMode demo and it worked fine. Now I'm doubly confused.

Update: I have now figured out how to fix the actual collision- it works great once you change the SpriteCollisionMode (beginner's mistake). I still don't get the discrepancy in the red box display, though. Anyone?

kevin

Yes, the debug collision modes have some dramas when captured/drawn through a camera.

Tracy

#2
QuoteYes, the debug collision modes have some dramas when captured/drawn through a camera.

Ah. 'Dramas'- good word. :) At least it's not just me. Thanks for the clarification, Kevin. (Honestly, though, they're still helpful- I figured out what I needed to with them.)

P.S. Grats on the new system.

kevin

I have been meaning to fix that.  Can certainly be annoying..  Maybe thursday.. :)