Projectile-enemy collision

View previous topic View next topic Go down

Projectile-enemy collision

Post  manuelmartinf on Wed Sep 16, 2009 5:17 am

In my first person shooter little project, I have implemented some spheres as the "enemies" and I have used a little sphere as the projectile.
I have replaced the code of sio2PhysicsCollisionCallback for a new code that, in case of projectile-enemy collision, calls to

Code:
sio2PhysicRemoveObject( sio2->_SIO2physic, _SIO2object0 );
sio2ObjectFree( _SIO2object0 );

for the two objects (the projectile and the enemy).

When I execute the "game" the collision is detected but I takes too many time to visually eliminate the enemy from the scene.

There is a better way to implement the projectile-enemy collision?

Thank you very much!!!

manuelmartinf

Posts : 14
Join date : 2009-09-13

View user profile

Back to top Go down

Re: Projectile-enemy collision

Post  oioioi on Wed Sep 16, 2009 9:50 am

if the weapons in your game shoots small bullets(not rockets) you could just use a ray to test for collision unless you want the player to see the bullet. In this approach you also don't need to create a bullet object

oioioi

Posts : 136
Join date : 2008-12-02
Location : Norway

View user profile

Back to top Go down

Re: Projectile-enemy collision

Post  manuelmartinf on Thu Sep 17, 2009 5:53 am

Thank you, I'll try the ray test

manuelmartinf

Posts : 14
Join date : 2009-09-13

View user profile

Back to top Go down

Re: Projectile-enemy collision

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum