Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Implementing ng's collision system into my pong game.

Author
Message
Mr Monkey Man
20
Years of Service
User Offline
Joined: 22nd Feb 2004
Location: UK
Posted: 15th Apr 2004 22:05
How would I use ngs collision system to check for collisions between the ball and the paddle then how do I assign actions depending on wether or not a collision happened.
Thankyou
If you need to look at the code just ask
Thanks again

*For every problem you come across you gain something from correcting it, I hope.
Blue Shadow
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 15th Apr 2004 22:25
Are you coding your game for 2d or 3d? NG's collision system only works for 3d.

Cheers,

Michael


Visit the Code Monkey's website at http://www.freewebs.com/codemonkeystudios
Mr Monkey Man
20
Years of Service
User Offline
Joined: 22nd Feb 2004
Location: UK
Posted: 16th Apr 2004 00:09
3D do you wont to look at the code

*For every problem you come across you gain something from correcting it, I hope.
nuclear glory
20
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 16th Apr 2004 08:10 Edited at: 16th Apr 2004 08:12
I just posted on your other thread I think.

Let me get the post and stick it here.

Here it is:

---

It's not too bad.

StartCollisionPRO()
StartCollisionDebugPRO()

Define some custom types:

TYPE_ELLIP = 1
TYPE_MESH = 2

Then, are you doing ellip-2-mesh or ellipsoid-to-ellipsoid detection?

For ellipsoid-to-mesh, use the command:

SetCollisionsPRO( TYPE_ELLIP, TYPE_MESH, ELLIP_2_POLY, RESP_STICK, DYN_RESP )

For ellipsoid-to-ellipsoid collision use:

SetCollisionsPRO( TYPE_ELLIP, TYPE_ELLIP, ELLIP_2_POLY, RESP_STICK, DYN_RESP )


Then define which of your objects are meshes and which are ellipsoids. Example:

CollisionTypePRO( pong_ball, TYPE_ELLIP )
CollisionTypePRO( pong_world, TYPE_MESH )


Then move your objects as normal and call RunCollisionPRO() once per main loop.

Then you can detect if you pong ball hit a wall (or paddle) with:



If we made it any simpler the system would lose its dynamic power.

Lead Programmer/Director
Powerful Collision DLL for DBPro and DBC: http://www.nuclearglory.com

Login to post a reply

Server time is: 2024-09-22 05:41:09
Your offset time is: 2024-09-22 05:41:09