sprite collisions?
Posted: Wed Jan 03, 2024 2:10 pm
I've read the documentation and various tutorials on sprites and sprite collisions plus played with all types of code .. but can't seem to figure out a simple way of doing what I want. Any help or pointers in the right direction would be much appreciated:
A simplified scenario of what I am doing is that I have some alien sprites (eg say 10 active at once) and a bullet sprite (ie 1 active). Sprite collisions is activated, mask for alien sprites is 0011xxxx and mask for bullet sprite is 0001xxxx.
Am I right that a sprite collision interrupt is triggered:
(i) when any of the aliens collide (Collisions in ISR will be 0011)?
(ii) when a bullet collides with alien (Collisions in ISR will be 0001)?
(iii) when both of the above happen at the same time (Collisions in ISR as 0011)? [Edit: Actually is 0001 per note below]
My question is - is there a way to distinguish between scenario (i) and scenario (iii) without doing a full "row/column overlap" search between the bullet and all aliens? I simply want to ignore scenario (i) (ie it's ok if the aliens "overlap") but of course for them to be "hit" when a bullet hits them.
A simplified scenario of what I am doing is that I have some alien sprites (eg say 10 active at once) and a bullet sprite (ie 1 active). Sprite collisions is activated, mask for alien sprites is 0011xxxx and mask for bullet sprite is 0001xxxx.
Am I right that a sprite collision interrupt is triggered:
(i) when any of the aliens collide (Collisions in ISR will be 0011)?
(ii) when a bullet collides with alien (Collisions in ISR will be 0001)?
(iii) when both of the above happen at the same time (Collisions in ISR as 0011)? [Edit: Actually is 0001 per note below]
My question is - is there a way to distinguish between scenario (i) and scenario (iii) without doing a full "row/column overlap" search between the bullet and all aliens? I simply want to ignore scenario (i) (ie it's ok if the aliens "overlap") but of course for them to be "hit" when a bullet hits them.