Many questions about collisions

Blitz3D Forums/Blitz3D Programming/Many questions about collisions

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Thanks for replies, linepick and entity distance are nice alternatives and I may use them later on. But back to collision functionality.
Is there way to get 'Type' object that was collided?
Lets say I have two Types and I perform collision checks

Type Target
  Field entity
End Type

Type Bullet
  Field entity
End Type

myBullet.Bullet = new Bullet 
myTarget.Target = new Target
...
For t.Target=Each Target
  If CountCollisions( t\entity )
    If EntityCollided( t\entity, TYPE_BULLET )
      For k=1 To CountCollisions( t\entity )
        If GetEntityType( CollisionEntity( t\entity,k ))=TYPE_BULLET
          ; now I can free Target entity and delete Target object if I wish, but..
          bullet = CollisionEntity( t\entity,k )
          ;
          ; WHAT NOW? I have 'bullet' entity that I can free but how to get Bullet type object that holds that entity?
          ;
        EndIf
      Next
    EndIF
  EndIf
Next
 


I know, my current method works ok but above system could cut half the code load. Am I trying to optimize too much? :)