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 Discussion / Object collision!

Author
Message
r333
20
Years of Service
User Offline
Joined: 18th Jul 2005
Location:
Posted: 30th Jul 2005 04:56
I want to set object collision with 3d objects I make, but the only command I see is "set global collision on", but it doesn't work.
master programmer
21
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 30th Jul 2005 05:22
the global collision command doesn't work how you think. Instead, I would use set object collision on OBJECTNUMBER. Then, the objects will still go through each other, so you have to program them to do something when they collide, like move object OBJECTNUMBER,-1 for more code on this, view my code snippet and search around CodeBase for more help.



You don't necessarily have to use the set object collision on command, you just need the if object collision(OBJECT1,OBJECT2)=1 command. It helps to have the set object collision on command, but I hardly use it.

-------------------
Vote for Excelsis on the puzzle game compo

__________________________________________
<<<<<Check out my sites>>>>>
www.rhettgames.tk | www.slayerbattletanks.tk
r333
20
Years of Service
User Offline
Joined: 18th Jul 2005
Location:
Posted: 30th Jul 2005 05:33
Thanks a lot master! I'll try it right now!
r333
20
Years of Service
User Offline
Joined: 18th Jul 2005
Location:
Posted: 30th Jul 2005 05:38
um....1 more question. This is cool if i set it one object at a time, but i am making a game with a lot of objects, and i don't want to set them all individually. Any ideas?
blanky
21
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 30th Jul 2005 23:26
Well, that's what 'set global collision on' is for, BUT...

Say all the objects you needed collision for were between 1 and 300:

For i=1 to 300
Set Object Collision On i
Next i

(If you had a few gaps where there weren't any objects
For i=1 to 300
If Object Exist(i)=1 then Set Object Collision On i
Next i

Etc.

[Insert extremely witty comment here]
r333
20
Years of Service
User Offline
Joined: 18th Jul 2005
Location:
Posted: 31st Jul 2005 15:31
Thanks a lot you guys, and I'm gonna get to work on this game!

Thanks!(for..whatever it is you did...)

Login to post a reply

Server time is: 2026-07-10 16:48:54
Your offset time is: 2026-07-10 16:48:54