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 / 3D Snake Game-Collision Help.

Author
Message
DBAlex
19
Years of Service
User Offline
Joined: 4th Oct 2004
Location: United Kingdom
Posted: 15th Jan 2005 21:51
Hi, Im making a 3D Snake Game in DB Pro.
Its from a 2D View but its 3D.



I need help with the collision. I need someone to edit it so that when object 1 collides with object 11, object 11 gets moved to somewhere randomly on the x and y axis and 1 is added to the "length" variable.

I have tried this but it is not working. I have also tried the object collision (object1,object2) command.

Please Help!!!

>_0
DBAlex
19
Years of Service
User Offline
Joined: 4th Oct 2004
Location: United Kingdom
Posted: 15th Jan 2005 23:35
Can anyone help here?

?

>_0
Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 16th Jan 2005 01:20
You comparing floats with = which aint gonna work

instead of if a=b and c=d
use:
x=thickness of cube (10 in your code)
if abs(a-b)<x and abs(c-d)<x

but on the whole I'd use a 2D array to store the x,y of your segments- will make collision checks much faster.

Check some of the compo snake entries they all have source code.


The word "Gullible" cannot be found in any English Dictionary.
DBAlex
19
Years of Service
User Offline
Joined: 4th Oct 2004
Location: United Kingdom
Posted: 17th Jan 2005 03:30
Thanks.

and btw Port Vale are teh 0wnage !11



>_0
Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 17th Jan 2005 05:56

I'm a glory hunter




The word "Gullible" cannot be found in any English Dictionary.

Login to post a reply

Server time is: 2024-09-23 09:31:06
Your offset time is: 2024-09-23 09:31:06