Collision solution (need advice)


Since I’m still new to panda3d, I would greatly like to have your advice on my collision solution. Nothing has been coded so far, I just want to be sure that this is the best way to do it.

Ok so the game: You control a space fighter, you shoot missile or things like that to bad spaceship in front of you.

My idea of solution: Put a CollisionSphere around the space fighter, put a collisionSphere around all of the ammo that is shooted (for example, if 2 missiles are shooted, there are 2 collisionSphere around them). And finally, put a collisionsphere around the bad guys.

All I will need to program is the different collision event. So that when a missile touch the bad guys, they explose or -50 dammage, or something like that.

I pretty sure it’s the way to do it but I may be wrong… I was wondering also if this way will affect performance if there is a lot of projectile?

Second question: What is the best way for my bad guys to “see” in front of them? A collision ray? For example, if I want some bad guys to have a vision of 30 degree and other of 60 degrees?

Thanks !!


we used collision segments …

best way just to make your guys look at the player if he is 30 degrees left right or up or down of the bad guys facing treat it like bad guy does not see him. Collision ray will never pick up a good guy because it just a line.[/img]

I’m just getting back into panda after a little bit of bed rest
from my first go around with it, but I read somewhere that
having a collision sphere on each bullet could be problematic,
as sometimes it passes through the enemy.
It was the ‘bullet through paper’ collision post, I can’t remember
what it was called.
For bullets I’m going to try a long collision tube, so it just gets
whatever is in front of it, I still have to do it though, and this
also might be a stupid way of doing it, but its an extra idea for you.

andy circus, you can just use collisionspheres, and enable panda’s anti-quantum-tunneling system, which will prevent the ‘bullet through paper’ effect. … ng_Objects

Thanks, I was going to model some kind of
collision laser, or something LOL!

Thanks a lot!

I will try that soon, right after the holidays! And treeform, your game really rocks. Mine is influenced by arcade game so it’s a little bit different but a lot of mechanics that you programmed will help me do mine.

Thanks again

Jaff :smiley: