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.

Code Snippets / Small commented basic collision (DBP)

Author
Message
Darth Vader
19
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 17th Feb 2006 08:40
This is probably useless, but I have seen a few newbies going round asking how to do basic collision! So I used this piece of code which is the most simple of all collision functions FULLY commented to provide an easier understanding of basic 'hit a wall and stop' scenarios.

I do hope to add slide collision soon. Please note this is not a plugin and I only did it to help some of the newbies. So please don't flame me if you think this is useless.

Thanks!



You Don't know the power of the Dark Side!!
Oh but I do!!
Darth Vader
19
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 20th Feb 2006 05:59 Edited at: 20th Feb 2006 06:02
Here is an updated version of the collision code. This will handle multiple object collisions.


Hope this helps!


Oh please do tell me what you think!

You Don't know the power of the Dark Side!!
Oh but I do!!
Darth Vader
19
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 28th Feb 2006 13:54
Comments anyone?

You Don't know the power of the Dark Side!!
Oh but I do!!
Darth Vader
19
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 13th Mar 2006 11:21
Okay here is another small update to this simple collision thread. It deals with matrix collision.


I have left out the 'get ground height' commands and the Y position collision checking for any one else to have a crack shot at.

Oh and please do comment and tell me if I am wasting my time!

Darth Vader

When in Trouble with anything visit here your number one stop for help
Okashira
18
Years of Service
User Offline
Joined: 8th Feb 2006
Location: Right here.
Posted: 14th Mar 2006 22:49 Edited at: 14th Mar 2006 22:50
This only works with Pro, doesn't it?

EDIT : Oops, just saw the subject. I stupid .

Let the games begin!
Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 16th Mar 2006 00:58
Here is a dbc version


Was quite easy to edit..


Darth Vader
19
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 16th Mar 2006 02:51
@Dodic
Thanks! I dont have or know the difference with the two darkBASICS

When in Trouble with anything visit here your number one stop for help
Thexter
18
Years of Service
User Offline
Joined: 1st Mar 2006
Location:
Posted: 18th Mar 2006 03:05
I took your code and turned it into a dumb little game..
yeah!! Im a noob!
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 14th Jun 2006 02:41
Thexter,

That little "Game" could actually become addicting if you added enemies and more onto it! Of course with you joining a little over a month ago I do not expect you to be able to do that... But if you could it'd be funny! You could add a time limit that you have to reach the cube each time it moves! Objectve could be to hit the green cube w/out hitting the enemies! Just a little pitiful idea

I doubt you can draw me/60 by hand, so you REALLY can't draw ME/1, can you?
Jester Race
18
Years of Service
User Offline
Joined: 13th Jun 2006
Location:
Posted: 14th Jun 2006 16:11
If i was to change darth's code like so:

Would the box travel along the new ground heights? The reason i ask
is that i think it should, but for some reason it just doesn't work for me. It just seems to jump around at random heights.
Darth Vader
19
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 28th Jun 2006 07:51
@ jester
It works fine for me!

I have the longest Biog under my profile button!

"You don't know the power of Dark Basic Pro!"

-Darth Vader-
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 6th Jul 2006 12:27
Polygon collision works better on other objects.

Cubes can be box collision but Modeled models should be PolyGon collision...


Many tales has bein told about me,and there where i came from.Most bad ones are true.The good ones are false...

Login to post a reply

Server time is: 2024-11-23 03:41:20
Your offset time is: 2024-11-23 03:41:20