Found a bug that can kill you
During the Vertical Blank the program converts the paddle reading to x-y sprite coordinates as well as setting the X sprite position of the top players and calculating the X positioning values for the bottom players. However, the sequence isn't in the correct order. It's not a major deal, unless you have captured a fireball. If you're holding a fireball then you run the risk of killing yourself even if you've not lost a single brick!The program does the following:
1) Positions the X position of the top players
2) Precalculates the X position of the bottom players
3) Converts all paddle readings to X-Y values
4) starts drawing the visible portion of the screen, where the Y values are used.
The problem occurs when you(as the yellow player) are all the way to the left
And you're trying to move all the way to the right to attack the opposite player
The problem is the paddle readings are converted before the Y value is used, but after the X value is used. By doing this the X value of a paddle reading displayed with the Y value of the next paddle reading and your shield can end up within the wall
or worse, by the king.
If you are holding the fireball and end up by your king then you just killed him. This problem happens to all players.
The fix is to move step 3 to step 1, and move step 1 and 2 down to steps 2 and 3.
3 Comments
Recommended Comments