Collisions will set the general parameters of what kind of collision checking are we doing (ie 1: ellipsoid-to-ellipsoid collisions; 2: ellipsoid-to-polygon collisions; 3: ellipsoid-to-box collisions ),
and how to handle such collisions when they occur: (ie 1: stop ; 2: slide1 - full sliding collision ; 3: slide2 - prevent entities from sliding down slopes ).
So, yes, you can set Collisions for an entity that does not yet exist. When you create the entity, you will need to assign to it what type of entity it is (ie bullet=3).
As far as 2 (or more) things colliding at once, collisions are put into a queue (a list). Blitz will automatically set into motion the response that you already assigned via Collisions (ie, stop, slide, etc). Your interest, then, is not how to handle the collision as such, since the Collisions command does that for you, but to determine what else you want to happen as a result of the collision (ie a bullet damages/kills the target entity, etc).
mindstorm's method is good. It allows for the possibility of sorting out what types of collisions occurred (ie collision with an entity of type 1, type 2, type 3, etc.), and allows you to set up what you want to happen on the basis of what KIND of entity you collided with (ie bullet, wall, etc).
Say your player character collides with a wall just as he gets shot with a bullet. The Collisions settings will tell Blitz that, for instance, colliding with the wall will allow you to slide, whereas the bullet hitting will just stop dead in its tracks (heh heh, play on words, dude). Now, regarding the colliding with the wall, say for instance, you don't really want anything special to happen to the player character, but are content to allow him to "slide". However, since a bullet also hit him, now, you have to work on what damage was done. mindstorm's method allows you tp sort through the list of collisions so that you can focus in on the bullet hitting, and have your code do appropriate damage to the player. The code for sorting it all out should look something like this:
So, the logic is as follows:
Step 1:
CountCollisions tells how many collisions there were
(Blitz keeps track of this).
Step 2:
CollisionEntity tells which entity collided.
Step 3:
GetEntityType tells what type entity it was.
Now, you have an identification, not merely that a collision occurred, but which entity did the colliding, and what type entity it is.
Cheers :)
and how to handle such collisions when they occur: (ie 1: stop ; 2: slide1 - full sliding collision ; 3: slide2 - prevent entities from sliding down slopes ).
So, yes, you can set Collisions for an entity that does not yet exist. When you create the entity, you will need to assign to it what type of entity it is (ie bullet=3).
As far as 2 (or more) things colliding at once, collisions are put into a queue (a list). Blitz will automatically set into motion the response that you already assigned via Collisions (ie, stop, slide, etc). Your interest, then, is not how to handle the collision as such, since the Collisions command does that for you, but to determine what else you want to happen as a result of the collision (ie a bullet damages/kills the target entity, etc).
mindstorm's method is good. It allows for the possibility of sorting out what types of collisions occurred (ie collision with an entity of type 1, type 2, type 3, etc.), and allows you to set up what you want to happen on the basis of what KIND of entity you collided with (ie bullet, wall, etc).
Say your player character collides with a wall just as he gets shot with a bullet. The Collisions settings will tell Blitz that, for instance, colliding with the wall will allow you to slide, whereas the bullet hitting will just stop dead in its tracks (heh heh, play on words, dude). Now, regarding the colliding with the wall, say for instance, you don't really want anything special to happen to the player character, but are content to allow him to "slide". However, since a bullet also hit him, now, you have to work on what damage was done. mindstorm's method allows you tp sort through the list of collisions so that you can focus in on the bullet hitting, and have your code do appropriate damage to the player. The code for sorting it all out should look something like this:
For loop=1 to CountCollisions(player_entity) which_entity=CollisionEntity (player_entity,loop) my_type=GetEntityType (which_entity) ;put in code for handling what you want to happen ;with entity named which_entity based on which ;entity type it is, according to the my_entity that ;was returned from GetEntityType. Next
So, the logic is as follows:
Step 1:
CountCollisions tells how many collisions there were
(Blitz keeps track of this).
Step 2:
CollisionEntity tells which entity collided.
Step 3:
GetEntityType tells what type entity it was.
Now, you have an identification, not merely that a collision occurred, but which entity did the colliding, and what type entity it is.
Cheers :)