Tried Collision detection sprite vs bitmap


At first, I tried a sprite created from my bitmap. But somehow, I couldn't get good result. So, I tried to use rectangle like picture 1.

The picture 1 shows rectangles which use palette#0 to 15 on background bitmap(4bit planes). The sprite(#0) is 4x4 rectangle with color#0-3 (2bit planes). If I use "SetColl 1,4", PColl(0) gets TRUE when sprite is over the color#1 rectangle. Good :)

I wonder that why SetColl takes bit plane param? It depends on(and should be) bitmap's depth isn't it? So, it doesn't need really. But it can take param.. Let me try this. I tested "SetColl 1,2". The result is that PColl(0) gets TRUE when the sprite is over the #1,#5,#9,#13. Ah, those color# has 0b01. How about "SetColl 1,3"? The result is PColl(0) gets TRUE when it is over the #1,#9. Interesting! More said, if I set "SetColl 1,1", PColl(0) is TRUE when palette# is odd. This is exactly same as "SetCollOdd". 

SetCollHi also takes bit plane#. The manual said I should set the number of bitplanes of bitmap. But not said "must". If try "SetCollHi 2" for this 4 bitplanes bitmap, PColl(0) is TRUE when splite touches #2,3,6,7,10,11,14,15. Those color# has 0b10. Maybe I won't use this but interesting.

I took many time on this experiment though. Anyway, back to try collision detection with my bitmap. The picture 2 is that. The plane hits bitmap and back screen turns red. Yay!

Accomplishment:

  • Tried collision detection

Get My First Shooting Game For Amiga

Leave a comment

Log in with itch.io to leave a comment.