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.

Dark Physics & Dark A.I. & Dark Dynamix / Linking balls like a chane error on extra ball.

Author
Message
ClickDesign
14
Years of Service
User Offline
Joined: 20th Jun 2009
Location: Birmingham
Posted: 20th Jun 2009 23:19
The code below works but the last ball out side the loop falls off.
any ideas what im doing wrong as im new to the phyics in DB pro.

I thought it would link to the rest of the balls as part of the loop.

Y# = 17

for i = 5 to 10
make object sphere i, 0.5+(i*0.4)
position object i, 10, Y#, 0
color object i, rgb ( rnd ( 255 ), rnd ( 255 ), rnd ( 255 ) )

phy make rigid body dynamic sphere i
phy make sphere joint i, i, i - 1, object position x ( i ), object position y ( i ), object position z ( i )

color object i, rgb ( rnd ( 255 ), rnd ( 255 ), rnd ( 255 ) )
set object specular i, rgb ( rnd ( 255 ), rnd ( 255 ), rnd ( 255 ) )
set object ambient i, 255
set object specular power i, 255

Y# = Y# - 2
next i

Y# = Y# - 2
i=i+1
make object sphere i, 1
position object i, 10, Y#, 0
color object i, rgb ( rnd ( 5 ), rnd ( 5 ), rnd ( 5 ) )

phy make rigid body dynamic sphere i
phy make sphere joint i, i, i - 1, object position x ( i ), object position y ( i ), object position z ( i )

color object i, rgb ( rnd ( 5 ), rnd ( 5 ), rnd ( 5 ) )
set object specular i, rgb ( rnd ( 5 ), rnd ( 5 ), rnd ( 5 ) )
set object ambient i, 255
set object specular power i, 255



I bet its somethink simple i cant see...lol

Game designer
BillR
21
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 13th Aug 2009 13:46 Edited at: 13th Aug 2009 13:47
Hi ClickDesign, did you get the problem solved?

can you include a working piece of code that compiles
also use the code button when you post your code.
click the code button
position the cursor after the -code-
paste your code
click the code button to close your code in your post

Login to post a reply

Server time is: 2024-04-25 14:02:53
Your offset time is: 2024-04-25 14:02:53