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.

Newcomers DBPro Corner / collisions

Author
Message
Jp in da house
18
Years of Service
User Offline
Joined: 29th Apr 2006
Location:
Posted: 13th Jun 2006 23:37
Hi i have set up an object and a track and have currently og the following code:


load object "c:\track.x" , 2



set global collision on
rem Load object
load object "c:\boat.x",1






color backdrop 120


rt#=.6
speed#=.2
do
set camera to follow object position x(1),object position y(1),object position z(1),object angle y(1),5,1,3,0

if upkey()=1 then move object 1,3


if shiftkey ()=1 then move object up 1,.1
if spacekey ()=1 then move object down 1,.1
if leftkey()=1 then rt#=rt#-speed#
if rightkey()=1 then rt#=rt#+speed#
yrotate object 1,rt#

loop


-------------------------------------------------------------------

I would like to add collisions so that when my object hits the wall it stops but however how hard i try i just cant apply collisions.

thanks any help will be deeply appreciated

jack
Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 14th Jun 2006 01:26
If you just want to use Dark Basic Pro commands you can use intersect object.

If you are ok with using a dll then I suggest sparky's dll. It is faster than Dark Basic Pro commands. Here it is.

You could also buy nuclear glory collision.

Insanity is just a state of mind
Jp in da house
18
Years of Service
User Offline
Joined: 29th Apr 2006
Location:
Posted: 14th Jun 2006 22:32
where would i put the intersect command????
could you copy my code and put the intersect command in it and post the whole code

it will be greatly appreciated

thanks jack
Heckno
20
Years of Service
User Offline
Joined: 8th Sep 2004
Location: Palm Coast, FL
Posted: 14th Jun 2006 23:21
intersect command is a frame killer, get sparky's dll and learn it..

if you must use intersect object command it goes in the program loop so that it can be called when the object is moving...
Jp in da house
18
Years of Service
User Offline
Joined: 29th Apr 2006
Location:
Posted: 14th Jun 2006 23:35
could you insert the colision code into my code?
it so confusing
Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 15th Jun 2006 00:47
Just like Heckno said, intersect object is a frame killer. However, this is how I would code basic collision using the intersect object command if I were to use it.

I had to use a sphere and a box while I did this since I didn't have your models, but it should work quite well with your models.



Insanity is just a state of mind
Jp in da house
18
Years of Service
User Offline
Joined: 29th Apr 2006
Location:
Posted: 15th Jun 2006 21:52
thanks a lot mate that is really helpful it works fine that last code

once again thanks
jack

Login to post a reply

Server time is: 2024-09-25 01:20:56
Your offset time is: 2024-09-25 01:20:56