FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Projectile-enemy collision

2 posters

Go down

Projectile-enemy collision Empty Projectile-enemy collision

Post  manuelmartinf 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

Back to top Go down

Projectile-enemy collision Empty Re: Projectile-enemy collision

Post  oioioi 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

Back to top Go down

Projectile-enemy collision Empty Re: Projectile-enemy collision

Post  manuelmartinf Thu Sep 17, 2009 5:53 am

Thank you, I'll try the ray test

manuelmartinf

Posts : 14
Join date : 2009-09-13

Back to top Go down

Projectile-enemy collision Empty Re: Projectile-enemy collision

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

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