Collision Issue

Blitz3D Forums/Blitz3D Beginners Area/Collision Issue


I changed my movement system to use TranslateEntity instead of PositionEntity, then the collisions worked fine.


Great minds... ;)


The only thing is to make it work I had to have both "Collisions PLAYER,AST,1,2" and "Collisions AST,PLAYER,1,1" is it normal that I would have to have both of those for it to work?


I'll say yes, because we're talking about computers and computers are dumb. Just as it is possible to have a one-sided object, it is possible to have one-sided collisions... unlike in the real world, the existence of one "side" does not infer the existence of the other. The first Collisions command is only concerned with what the Ship has hit and until you create an additional command to keep track of what the Asteroids have hit, they can't hit anything.

If you think about it, though, this is smart: If the compiler assumed that every time the ship hit an asteroid you also wanted a record of the asteroid hitting the ship *without you asking for it* the CPU could potentially waste a lot of time collating information that you just don't need. The system is geared for speed and processing no more information than you specifically request.