Name: | No Sprite Interaction Fix |
Author: | chillyfox |
Added: | |
Tool: | Asar |
Requires Free Space: | Yes |
Bug Fix: | Yes |
Featured: | No |
Description: | Depending on sprite slots, sometimes a few sprites won't interact with other lower priority sprites, like Thwomp vs shell, so this small patch gives consistent sprite-on-sprite interaction to a couple of enemies: Thwomp Thwimp Fire Snake |
Tags: | fire snake hopping flame interact interaction lorom sa-1 shell sprite sprite contact thwimp thwomp |
Comments: | 4 (jump to comments) |
Download
859 bytes | 426 downloads
Comments (4)
It loops through the slots like this:
And therefore, sprite interactions are “one-way” as to prevent the collision code to run twice by each of the two sprites in question (only the sprite with the higher index handle the collision of both).
The thwomp, thwimp, and hopping flame DID NOT call $018032 but shells and any other kickable sprites DO call $018032, despite their tweaker settings are set to interact with other sprites. In order for an interaction code to be executed, the sprite with the higher slot MUST call $018032 in order for it to happen. And if that higher slot happens to be a thwomp, thwimp, hopping flame, then no interaction is processed which that is a bug.
Even further detail (but not a major problem) is that the routine will entirely skip if both Sprite_A's index and the frame counter $13 are even or odd. If one is odd and other is even, then it will process the interaction. Therefore half of the slots are processed in one frame, while the other frame are the other half of the slots. This is to prevent huge slowdown, as assuming all 12 slots are used up and calls $018032, there would be 66 possible combination pairs of the 12 sprite slots ((12!)/(2!(12-2)!) = 66).