[stella] joustpong: 1 bug squashed. 1 bug appears....

Subject: [stella] joustpong: 1 bug squashed. 1 bug appears....
From: KirkIsrael@xxxxxxxxxxxxx
Date: 16 Feb 2004 00:27:53 -0000
Well, I'm proud of myself that I really focused in and debugged the phantom brick issue that had been bugging me for so long, by setting up special test cases and finding out what caused the problem...basically, if it detects a ball/wall collision, it looks at the ball position and figures out what brick got hit. It turns out, though, that the ball could hit two bricks at once, if it was exactly in between them. Fair enough, the game would round off and the top brick would get removed...but if the ball hit between a brick and the empty space above it, the program would happily still try to "remove the top brick"...which was already gone, duhhr. So now it just does a trick... it KNOWS the ball hit, it then sees if the brick it's gonna remove is already gone, and if so, removes the one below instead.

But now I have another bug...and I put in some decent debugging stuff, but to no avail. I'm experimenting with variable vertical speeds for the ball. For my first attempt, I was just gonna grab the hit player's vertical speed (the integer byte of it, now that I'm using sub-pixel speed and positioning) and make it the vertical speed of the ball. 

	lda slowP0YSpeed+1
	sta ballVertSpeed

But, as you can see with today's ROM by just letting the player fall--speed'll be zero--the ball's rebounding up. I added a diagnostic: left player's score is set to the binary version of left player's speed (integery byte), right player's score is set to the bits of the ball's vertical speed. The player's speed meter is about what I'd expect, (often zero, small positive going up, small negative going down) but the ball's speed seems to be -1 as soon as it hits. And I couldn't see anything in between the collision and the meter display that changes the ball speed...

Anyone willing to take a glance at it for me? I thought sure my awesome diagnostic skills (using the score as speed display) would give me a hint, but I'm stumped...and I double checked,
	lda slowP0YSpeed+1 is the integer part of the speed,
	lda slowP0YSpeed is the fractional part...
I almost thought I was having some kind of memory leak (some 16 bit math 'slipping') but I just dunno...

Usual blog: (what this email was cut, pasted, and edited from...)

KirkIsrael@xxxxxxxxxxxxx    http://kisrael.com
 "My mind is especially empty today."
    --goofy looking buddhist monk to second monk, New Yorker cartoon 

Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/

Current Thread