Projectile-enemy collision
2 posters
Projectile-enemy collision
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
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!!!
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
Re: Projectile-enemy collision
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
Re: Projectile-enemy collision
Thank you, I'll try the ray test
manuelmartinf- Posts : 14
Join date : 2009-09-13
Similar topics
» Gun or cannon? Actual projectile or ray based?
» md2 collision
» Collision Detection
» Collision Again
» Collision system
» md2 collision
» Collision Detection
» Collision Again
» Collision system
Permissions in this forum:
You cannot reply to topics in this forum