From cdded307f90d28bb733b3566a3e9651112e90733 Mon Sep 17 00:00:00 2001 From: Jeremy Rand Date: Sat, 26 Dec 2020 15:03:29 -0500 Subject: [PATCH] When looking for collisions, treat the lowest collision as the one that counts. Before this, if you had two stacked mushrooms, it was possible to shoot through the mushroom below and "hit" the mushroom above. This happened because the first collision found was the one that the game handled. If the shot ended up being draw across both mushrooms, then the upper mushroom would record the collision. Now, the collision we care about most is the lowest one which should ensure that the bottom mushroom records to collision always with stacked mushrooms. This is similar to the "shoot through a partial mushroom" problem but is restricted to just when the mushrooms are stacked. --- BUGS.md | 1 - BuGS/sprites/sprites.macros | 3 --- 2 files changed, 4 deletions(-) diff --git a/BUGS.md b/BUGS.md index 892d4ac..9b74465 100644 --- a/BUGS.md +++ b/BUGS.md @@ -3,7 +3,6 @@ BUGS This is a list of the software bugs (as opposed to the bugs in the game that you shoot) that still need attention: - * I have seen some mushrooms appear suddenly. Sometimes, if I am shooting, the shot "hits" an invisible mushroom which then becomes visible. My guess is that there is something wrong with the code which turns a centipede segment into a mushroom when shot and the tile isn't correctly marked dirty all the time. * In theory, there shouldn't be a collision with an invisible mushroom but what happens is that when the shot overlaps with the tile, it becomes dirty. At that point, the mushroom will appear on the next frame and a collision can then occur. * It is possible to shoot between two segments of a centipede. The problem is that there are black pixels between the segments and if things are timed just right (or just wrong), the shot can slot in at those black pixels and end up missing both segments. diff --git a/BuGS/sprites/sprites.macros b/BuGS/sprites/sprites.macros index 7d4c13e..0e0939b 100644 --- a/BuGS/sprites/sprites.macros +++ b/BuGS/sprites/sprites.macros @@ -705,8 +705,6 @@ macro _collision &mask,&addr - ldy collision - bne _alreadyCollided_&SYSCNT tax and &mask beq _noCollision_&SYSCNT @@ -717,5 +715,4 @@ sta collisionAddr _noCollision_&SYSCNT anop txa -_alreadyCollided_&SYSCNT anop mend