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 / make object collision box command

Author
Message
Quack Master
19
Years of Service
User Offline
Joined: 17th Sep 2005
Location:
Posted: 24th Jul 2006 00:40
I have very patchy knowledge of DarkBasic, but I wanted to make a game since my brother(who initially got the program) never liked my ideas. I have a puzzle game where I push boxes around with a gray ball. I was having trouble with the collisions, in that the boxes would collide with on another and stop too soon, and so the space that is just big enough for the box will not let it in. I think that makes sense...I thought maybe the mysteriuos collision box might help, but I don't know how it works and the help menu doesn't work. The X1,Y1,Z1,X2,Y2,Z2 define diagonal corners is what I think, but it isn't detecting the collision. The ball goes through the boxes, and through the floor when I put in a command to make it fall(I'm not using gravity)

My general question, therefore, is what does one do with a collision box, and how does it work?

look at the turtle I tamed!
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 24th Jul 2006 05:24 Edited at: 24th Jul 2006 05:29
Make Object Collision Box is a simple command! Basically, the X1 is where it starts on the X axis, and X2 is where it ends. The same goes for everything else. You want the center of your object to be in the middle of your collision box, and the center of the object is at 0,0,0 with this command. So, if you had a box with the object number 11 and it its size was 10 on all axis, then you'd write

The 0 is because the collision box will not be continuously rotating. If it was, we'd put a 1 there. So basically, the first 3 numbes (X1 Y1 and Z1) are the negative versions of half of the object's size, and the next 3 are the positive versions. Here's another example:


It basically starts at 0,0,0 on your object, and goes out in a negative direction (with the X1 Y1 Z1) to the extent you specify, and then it goes out in a positive direction (with the X2 Y2 Z2) to the extent that you specify. That's all you need to do, for the collision box will now cling to the object like crazy glue. If you need a function for it I think that this would work:




None of this is tested but it should give you a general understanding of the command. I hope it fares out well for you in your game!

Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 1st Aug 2006 05:03
Grrr... did this help you at all?

Login to post a reply

Server time is: 2024-09-25 05:28:09
Your offset time is: 2024-09-25 05:28:09