Tuesday, April 11, 2006

Sweet Coding Joy!

posted by John Blanco @ 7:18 PM


Oh my frickin' jesus, I sometimes wonder why I got into the coding business. But, I guess it's times like these where it's worth it...

I've had this frickin bug in Avatara that has been wreaking havoc on my sanity the last few days. Game playing was just dandy, except for the fact that when black was promoting a pawn, all its pieces would disappear and then sometimes come back later and...WTF?!?!

The weird thing was that on the white board, all the pieces were fine. I was able to get some slightly different results when I changed up my testing. But, still, WTF?!?!

Tonight, I finally got an idea of what was wrong. You see, when you lift a piece, I swap the Flash depth of the piece to the highest, so it floats above the rest of them.

If you don't know Flash, I won't explain the depth details here. :-)

Well, I'd forgotten that instead of just using the square as a depth variable, I was adding to it with a constant. This way, I could put some movieclips at a depth lower than the pieces.

Well, when I swapped depths to the "moving depth," things were fine, but when I was bringing it back...I forgot to add that constant.

So, I'm not sure what the hell was specifically causing the error, but that was the symptom. What I'm going to assume is that when black was promoting, he was doing it at a square ID of 8 or less...which, when 10 is subtracted from it, comes out to negative something.

Can't be good. Could have destroyed any of the author-time stuff. Whoops! :-) No wonder it was black that was breaking!

OK, all good. DDR time. :-)


Post a Comment

<< Home