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 / Collision problem

Author
Message
Jp in da house
18
Years of Service
User Offline
Joined: 29th Apr 2006
Location:
Posted: 27th Jul 2006 20:58
HI i ahve the follwing code : [load object \"c:\\track2.x\" , 2


scale object 2,10,10,10

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

color backdrop 120


rt#=2
speedf#=.7


accel#=0.002
speed#=.007
pos#=0.00

do
set camera to follow object position x(1),object position y(1),object position z(1),object angle y(1),10,7,3,0


if upkey() = 1 then inc speed#,.03

move object 1,speed#

if downkey() = 1 then dec speed#,.06

move object 1,speed#



ox#=object position x(1)
oy#=object position y(1)
oz#=object position z(1)




dist#=intersect object (2,ox#,oy#,oz#,object position x(1),object position y(1),object position z(1))

if leftkey()=1 then rt#=rt#-speedf#
if rightkey()=1 then rt#=rt#+speedf#
yrotate object 1,rt#
loop]


the problem is that the collision wont work. could you help me ? and maybe change my code to a better colision type.


thanks all your help will be greatly appreciated
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 28th Jul 2006 02:15
That code has no collision code in it. What are you going to do with Dist#?

Jp in da house
18
Years of Service
User Offline
Joined: 29th Apr 2006
Location:
Posted: 28th Jul 2006 11:05
im confused
Dream And Death
18
Years of Service
User Offline
Joined: 21st Feb 2006
Location: The circus! Juggling job, kids and DBPro
Posted: 28th Jul 2006 11:36
You actually have to do something with the info returned from Intersect Object, it doesn't just turn on collisions for you.

"You get what everyone gets, you get a lifetime!" - Death, The Sandman Library

First you Dream, then you ... - Neil Gaiman, 2001
Jp in da house
18
Years of Service
User Offline
Joined: 29th Apr 2006
Location:
Posted: 28th Jul 2006 15:38
COUld you edit my example so i can see wat you mean?

thanks
Jp in da house
18
Years of Service
User Offline
Joined: 29th Apr 2006
Location:
Posted: 29th Jul 2006 15:27
How Do i do it then????

Login to post a reply

Server time is: 2024-09-25 05:31:42
Your offset time is: 2024-09-25 05:31:42