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.

Dark GDK / making collision PROBLEM

Author
Message
kareem3d
15
Years of Service
User Offline
Joined: 3rd Aug 2009
Location:
Posted: 4th Aug 2009 15:31
i have a problem --- when the player hit abox i have created it doesn't stop

i have used these code for collision:

dbSetObjectCollisionToBoxes(7);

"7" is the wall i need the player to collide
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 4th Aug 2009 16:27
Using collision is a little more involved than just telling an object to use a certain type of collision method.

You first need to do that, setup the objects to use collision. The, each game loop, you need to test for that collision, and then process the results accordingly.

Basically this is the procedure, first you would detect if there was a collision between objectA and objectB where objectA is moving into objectB and if there is a collision, then you would stop moving objectA.

That is a very basic logic example, but using that you should be able to figure out a coding method.

Also, as a last bit of advice, I would suggest using the "Sparky's Collision" plugin, its free and you can obtain it from the "DarkBasic Pro Collision DLL" thread in Program Announcements. It comes with some easy to follow examples and its commands operate alot more efficiently than the native db commands.

If it ain't broke.... DONT FIX IT !!!
kareem3d
15
Years of Service
User Offline
Joined: 3rd Aug 2009
Location:
Posted: 4th Aug 2009 16:38
i see.....,, i did downloaded SC_Collision but i don't know where to put the files!!!

Login to post a reply

Server time is: 2024-10-01 10:25:11
Your offset time is: 2024-10-01 10:25:11