PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Marks - Collision detection

Hi,
I'm developping a game where several sprites move in the game world and they all can collide with each other.

I am wondering how much of a drag on the game it would be to use the intersect method to check for collision instead of masks.

If I use the masks, I would probably have to rebuild the main mask each frame so that the current sprite tests for collision with other sprites but not himself... So if I have 6 sprites.. this means 25 blits/frame on the main mask to build a mask where the current sprite is not there... Am seeing this problem correctly ?

Thanks !
Hi,

Intersect is always faster than masks.. Intersect also performs a quick bounding box test first before starting a true pixel-by-pixel scan.
Can GAPDIDraw effectevely test a collision withs mask on a closed surface ?

Ex: A square building as 4 walls. Create a mask of the building with the inside of the building filled with the key color. If I put a sprite in the middle of the building and test for collision using getmaskid, will it work ?

I'm trying to do something similar and I'm getting strange results. At some positions when not touching the walls I get no collisions and at others positions still not touching the wall getmaskid returns a position and a maskid...

Thanks !
Yes it should work... :)
Hug · 24 Oct 2002, 19:09 UTC — Masks
If I'm colliding with maskid 993 and I have created only one maskid (992) what does that mean ?
Hug · 24 Oct 2002, 23:35 UTC — Masks
Problems solved.. my mistake..