On the Collision-Dection Sample

Hello, I was wondering if some one could help me out with this (hopefully it is quite simple to someone):

Working with the Collision dection sample (from the PANDA install) I have been racking my brain for a couple of days on how to implement using the ARROW keys to move the maze forward, backward, and side to side, as well as tilt it during the game (adding more of a challenge to the game!).

As a new person to Panda…and python ive been looking up API terms and structure… and have even dissected any sample that uses character movement (Ralph, the Room tut…)
but I still cannot get the maze to move around with the ARROW keys while still balancing the ball.

When complete I hope to post a sample to help new people like me.

Any help is appreciated!!! Thank you

Wow. it’s not easy to change this code in an arrow-keys code.

I suggest rewriting the tilt-code, that would be easier.

By the way. it’s detection, not dection. :wink:

Dang!, i was hoping that wouldnt be too difficult.

What I actually wanted to do was not change the game to arrow keys mode…but add to it. The arrow keys would slide the box up and down and side to side along the x&y plane. But the mouse would continue to tilt the box in the original way.

Does this approach still make the addition just as difficult?

I appreciate any help on this matter…this would be neat because characters could carry stuff etc.

Something like –[THIS]– ?
I changed it quite much here and there. Just compare them.
The ball sometimes get through the wall, even after respecting the previous transform. If you really like to shake the maze like crazy, you might use physics engine. Take a peek again, just get updated.

Yes! that is specifically what I wanted to try to do…I am definitely going to study the comparisons!. I appreciate this very much.

On a side note, I noticed the ball falling into the wall as well…in your opinion is it becuase it needs something more like PyODE to run correctly or would the whole collison detection algorithm need to be re-writtten to compensate for the arrow-key addition. Thanks again

If you like this limited behaviour, you should rewrite the collision response part. The orig only cares about collision towards the ball’s moving direction. When the maze hits it’s back, nothing happen, right ? You can add the maze’s movement vector into account when calculating the ball’s reflection vector.
About ODE, the pass-through may happen too, since it’s not equipped with built-in quantum tunnel auto-solver. It’s another problem I’ve never played with. I found some suggested approaches on ODE forum, but haven’t tested it.

Thanks ynjh_jo,
You have given me some excellant information & solutions. I will look into both…I cant tell you how much this has helped in terms of getting me started with this sort of thing.
I will probably try to rewrite the collsion code and once that works to some extent…try out ODE & see if that makes it more stable.

ynjh_jo,
Just played around with your OO ODE sample
…VERY well done!

Keep up the great work and thanks for sharing