The MASM Forum

Miscellaneous => 16 bit DOS Programming => Topic started by: ghjjkl on July 13, 2014, 10:48:45 PM

Title: collision detection
Post by: ghjjkl on July 13, 2014, 10:48:45 PM
recently i started thinking of fast collision detection between sprites and tiles which had been used in old dos/c64/zx spectrum/... programms. So there's my thinking:
all tiles should be aligned to tile grid. All the grid's cells must be the same size, power of 2, like 8x8, 16x16, 32x32 etc. It would make collision detection faster thanks to some bitwise operations. For example if sprite's position is 68, and tile's position is 64, to put sprite to right place i can simply do "and 68,64" and get sprite's position equal 64. But what if i want to detect collision between sprites? Should i use means like polygon intersection or this is wrong way?
Title: Re: collision detection
Post by: ghjjkl on July 18, 2014, 12:02:25 AM
case closed!