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 with enemy vs. collision with other object problems

Author
Message
2122
19
Years of Service
User Offline
Joined: 15th Aug 2005
Location:
Posted: 30th Aug 2005 04:43 Edited at: 30th Aug 2005 06:31
When the red sphere or box hits you, the screen is supposed to go black, and ask if you want to play again. Curently the sphere and box bouce of unless you land on them, or back into them at just the right angle. How can I fix this?

Here's the code:



Also, I am taking the binary moon tutorial.
I'm on the part with friction. I followed the directions, but I screwed up somewhere and I can't figure it out. Please tell me what I've done wrong.

here's the code:

BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 30th Aug 2005 06:59
not sure, but you could try using set object collision on instead of make object collision box. i might have the command wrong but it is something like that. btw, are you using DBC or DBP?
2122
19
Years of Service
User Offline
Joined: 15th Aug 2005
Location:
Posted: 30th Aug 2005 07:00
I'm using dbp
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 30th Aug 2005 15:34
I don't get why you are using integer values...

I know real values need more memory then integer values, but the accuracy will raise.
Put a # after all variables that are real.

Immunity and Annihalation makes Immunihalation...
2122
19
Years of Service
User Offline
Joined: 15th Aug 2005
Location:
Posted: 30th Aug 2005 23:54
It works with the # symbols. Can someone explain why please? Thanks for the help.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 31st Aug 2005 00:24 Edited at: 31st Aug 2005 00:26
The # symbol on the end of a variable name simply tells DB that you want that variable to store 'real' (floating point) numbers - like 1.23 or 3845.77.

If you don't use the # symbol they become integers - like 12 or 356.

3D space is a floating point environment. Using Floats, you can move an object 0.01 units whereas with using all integers, the smallest amount you can move is 1.

If your world's scale is small, 1 whole unit is a big distance - 100 times greated than .01.

However, when using floats, you should always put .0 on the end of numbers. Eg: instead of 12 you should put 12.0 though your program will still work if you don't.

Like Sven says, using integers you lose accuracy, and small losses of accuracy will build up over time until they are way out.

6.3 * 6.3 = 39.69

If you use:

A=6.3
B=6.3
Print A*B

it will ignore the .3 and give you the answer 36. However,

A#=6.3
B#=6.3
Print A#*B#

will print the correct answer.

This goes for Arrays too!

TDK_Man

2122
19
Years of Service
User Offline
Joined: 15th Aug 2005
Location:
Posted: 31st Aug 2005 04:35 Edited at: 31st Aug 2005 05:34
can I use a cube for a ramp? How can I make a static collision box for a slanted cube, and have the "car" change angles when it hits the box and drives up?

Here's the code so far:


Could someone also please explain the intercept object command to me please. I can't figure out what its used for.

Login to post a reply

Server time is: 2024-09-24 03:22:48
Your offset time is: 2024-09-24 03:22:48