Hi all,
This might come across as a bit of a rant, but I just want to check something
I have recently got back into DB (using DBP) after purchasing it about 2yrs ago. I have a specific goal to create a program, that will also give me the training in using the program, so I decided that I wanted to create a 3D pool game, so collisions and physics were going to be my stumbling blocks. So I purchases the relevant addons that I thought I would need, and use the tutorials that come with these addons to learn how to use them. But one thing I have noticed is that some of the code in them are wrong, and it is a real pain in not being able to copy out of the help file (I have to write out parts of the code manually) this does not help my learning, apart from becoming an excellent debugger wih all the weired messages about not defining a numeric equation
For Example
DarkPhysics - The Getting Started tutorial - should not really have any problems with this one.
From the book -
phy start
sync on
sync rate 60
autocam off
make object box 1, 10, 0.5, 10
position object 1, 0, -0.25, 0
phy make rigid body static box 1
position camera 0, 2, -4
levels = 20
ID = 1
for y = 0 to levels
for x = 0 to levels – y
make object cube ID, 0.2
color object ID, rgb ( rnd ( 255 ), rnd ( 255 ), rnd ( 255 ) )
position object ID, ( x + 0.5 * y ) * 0.21 – 1.5, y * 0.21 + 0.1, 0
phy make rigid body dynamic box ID
inc ID
next x
next y
do
if spacekey ( )
make object sphere ID, 0.6
position object ID, camera position x ( ), camera position y ( ), camera position z ( )
phy make rigid body dynamic sphere ID
phy set rigid body linear velocity ID, 0, 3, 10
inc ID
endif
phy update
sync
loop
Can you see anything wrong - try it?
I finally got it to work with the following code (see if you can spot the change!
phy start
sync on
sync rate 60
autocam off
make object box 1, 10, 0.5, 10
position object 1, 0, -0.25, 0
phy make rigid body static box 1
position camera 0, 2, -4
levels = 20
ID = 2
for y = 0 to levels
for x = 0 to levels - y
make object cube ID, .21
color object ID, rgb ( rnd ( 255 ), rnd ( 255 ), rnd ( 255 ) )
position object ID, ( x + 0.5 * y ) * 0.21 - 1.5, y * 0.21 + 0.1, 0
phy make rigid body dynamic box ID
inc ID
next x
next y
do
if spacekey ( )
make object sphere ID, 0.6
position object ID, camera position x ( ), camera position y ( ), camera position z ( )
phy make rigid body dynamic sphere ID
phy set rigid body linear velocity ID, 0, 3, 10
inc ID
endif
phy update
sync
loop
Please dont get me wrong DBP is an excellent program, but I feel the lack of proofreading and testing code before sending it out does seem a bit bad, especially for someone new to programming and want to learn using the tutorials that are included with a paid product. Can we have updated tutorials posted on the website, so we can update our local copies
So rant finished and I am sorry that I have had to post in the newcomers section, but I am a n00b
Cos it is!!