tom-seddon / ghouls-revenge

Ghouls: Revenge
3 stars 1 forks source link

Improve object collision: check key pixels only #22

Closed tom-seddon closed 2 months ago

tom-seddon commented 1 year ago

The game checks for collision by checking the object's entire dest area for specific pixels - e.g., https://github.com/tom-seddon/ghouls-tng/blob/e3927fba5c96bd58aa2d776d7a1003c87b3fdd2b/src/gmc.s65#L1919

But it doesn't necessarily need to check the whole thing. For example, out of the 32 bytes that make up a block's screen representation, only 16 of them can be $ff. So why check all 32?