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.

DarkBASIC Professional Discussion / Collisions anyone?

Author
Message
urgent help!
15
Years of Service
User Offline
Joined: 28th Sep 2010
Location:
Posted: 5th Oct 2010 19:48
So I'm pretty new at programming and need help figuring out the simple things in codeing, like collisions. Does anyone know how to add collisions to an object? I would love for you to show me, because I really need to learn how to add collisions to objects.
sneaky smith12
20
Years of Service
User Offline
Joined: 30th Apr 2006
Location: Like id tell you, oh wait i just did
Posted: 5th Oct 2010 20:55 Edited at: 5th Oct 2010 20:57
This is a difficult collision to answer. There are several types of collision. I would assume the type that you're looking for is sliding collision; however, that might be a large assumption.

I would recommend looking at the tutorial page for DBPro. I believe the Huge Dungeons has an example of very basic collision. My next suggestion would to be look for external DLLs such as Sparky's... if you use the Thread Subject Search you will find tons of information (well only a 100 at a time).

EDIT:
Sparky's is below... thanks... I really ought to save some of these links sometime or another.

If at first you dont succeed, LOWER YOUR STANDARDS.
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 6th Oct 2010 01:26
Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 6th Oct 2010 05:34
"How to add collision" is a pretty complicated topic. I mean, collision plugins use all sorts of optimization and complicated math to check for collision and then find an appropriate response.

Sparky's DLL would be your best bet, but you might want to start out with 2d stuff first, until you know the important things (functions, arrays, UDTs, etc.)

urgent help!
15
Years of Service
User Offline
Joined: 28th Sep 2010
Location:
Posted: 7th Oct 2010 22:08
Thank you all for your help but my friend figured out an easier way.

rem replace 1 with the number of the object you want collision for
c1 = object position x(1)
c2 = object position y(1)
c3 = object position z(1)
if object collision (1,0) then position object 1,c1,c2,c3
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 7th Oct 2010 23:09
That's it in about it's simplest form but your player might get stuck.

Login to post a reply

Server time is: 2026-07-22 03:51:32
Your offset time is: 2026-07-22 03:51:32