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.

DarkBASIC Discussion / box collision

Author
Message
Clbembry
18
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Minnesota
Posted: 16th Feb 2007 02:45
How would I code it so that when you land on a box, you stop. The way my code is when the ball colides with the top of the box, it goes into the middle of it. Here is my code:



Please tell me what I'm doing wrong.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 16th Feb 2007 08:13
It's very late here and I'm nodding off, so I may be talking rubbish, but after a cursory glance at your code, it looks like you aren't creating the collision boxes the correct size.

Your cubes are 100x100x100, but your collision boxes appear to be 20.

Check out the diagram in tutorial 10 here:

http://forum.thegamecreators.com/?m=forum_view&t=99497&b=7

TDK_Man

Clbembry
18
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Minnesota
Posted: 16th Feb 2007 16:55
It didn't work
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 16th Feb 2007 22:58


erm... OK right. At least we tried... I suppose... ?

TDK_Man

Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 19th Feb 2007 13:20
Okay I think I fixed your code:



Login to post a reply

Server time is: 2025-05-26 03:41:12
Your offset time is: 2025-05-26 03:41:12