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 / My Own Box Collision Function, Very Fast! (DBC, not tested in DBPro)

Author
Message
Preston C
21
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 30th Aug 2003 19:05 Edited at: 30th Aug 2003 21:53
Just a box collision function thats way faster than the original collision functions.



A simple collision function.
You must specify what objects to check for collision for o1 and o2.
objectwidth and objectdepth should be the width and depth of the collision box for o2
should o2 be 0, the function will search for collision from 1 to maxobjects
if nocollide is >0, if an object collides with the object specified
in nocollide, it will return 0.

Edit: Put code in code snippet box, source button screwed up the code. Rich, could you add code editing when editing posts?

Yet Another Edit: Forgot to have it check for y collision, heh.

Yet Another Edit: I'm an idiot, I didnt check my code entirely to see if it worked completely right, found 6 bugs which are now fixed, and it should work now!



Hell Begins September 2nd at 7:30 AM. Yep, schools starting soon. Ordered Dark Basic Pro. 1-3 Weeks remaining!
cusoi
21
Years of Service
User Offline
Joined: 3rd Jan 2003
Location: Netherlands
Posted: 1st Sep 2003 13:47
Nice code! Kaboom said the Chickens 3!

You only realize how happy you were, if you aren't that happy anymore...

Visit my site: www.cuso.tk
Preston C
21
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 1st Sep 2003 16:07
Finally, someone read my profile!



Hell Begins September 2nd at 7:30 AM. Yep, schools starting soon. Ordered Dark Basic Pro. 1-3 Weeks remaining!
Preston C
21
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 2nd Sep 2003 02:38
Feel like I'm posting on a dead thread but...

Did anyone actually try it? Does it work with your programs? Did I really screw up and embarrass myself? Somebody please answer.



Hell Begins September 2nd at 7:30 AM. Yep, schools starting soon. Ordered Dark Basic Pro. 1-3 Weeks remaining!
Preston C
21
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 5th Sep 2003 01:58
???

PLEASE SOMEONE FOR THE SAKE OF HUMANITY, PLEASE TELL ME I DID SOMETHING RIGHT FOR ONCE!!! DOES IT WORK? DOES IT NOT WORK? PLEASE TELL ME!!!!! I'M BEGGING YOU!!!


Ordered Dark Basic Pro. 1-3 Weeks remaining!
School Started, let the CHAOS BEGIN!!!
Inkybro
21
Years of Service
User Offline
Joined: 31st Dec 2002
Location: Where I live :)
Posted: 5th Sep 2003 22:11
NWC, I will try it out Talk to ya on AIM.

Don't turn your back on me, I won't be ignored! Faint - Linkin Park

One minute your on top! Next you're not, watch you drop! Linkin Park- Hit the Floor
Ocean Runner
21
Years of Service
User Offline
Joined: 18th May 2003
Location: United States
Posted: 6th Sep 2003 20:34
Kaboom said the chickens 3! Cool Code.

"Computers in the future may weigh no more then
1.5 tons.
- Popular Mechanics, 1949
Lukeyboy
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location:
Posted: 7th Sep 2003 02:57
Kaboom said the Chickens 3!
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 7th Sep 2003 03:24
Hey! You stole my idea!!!!!!!!!!!! i hate you!

Got a knack for finding secrets??? Jingot Racing --- A new brand of Racing --- Only from Nightwatch Studios

Chenak
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 7th Sep 2003 05:07
Yep works for me, great code

Kaboom said the Chickens 3
&
Blind Chicken tied to a fence post!##!

Once you start down the Dark Path, forever will it dominate your destiny...
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 7th Sep 2003 06:18
NWC - I did something similiar to this, only I created a function to create the object collision box similiar to what you are doing here, with Object Width and what not.

Lookin good

RPGamer

Current Project: Eternal Destiny
Porting all files to my new computer

Login to post a reply

Server time is: 2024-11-24 01:42:05
Your offset time is: 2024-11-24 01:42:05