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 / Help needed with indoor worlds and collision detection

Author
Message
Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 9th Jan 2007 13:47
Hi, I'm a newcomer to programming and DarkBasic, and have been struggling to get to grips with everything. I thought I'd start simple, so I created some fairly basic rooms (just two textured cuboids joined together) and exported them as a .X file, before loading them into DBC and creating a sphere to move around inside them.

Unfortunately, when I put in some code from one of the examples (which simply said that if the two objects were in contact then the sphere was to return to the X and Z coordinates it had had at the start of the main loop) the sphere refused to move anywhere.

I'm guessing that because the sphere is inside another object, it counts as a collision. Could someone please tell me how to get around this?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 9th Jan 2007 15:02
Standard collision boxes in DB are "solid". So if you assign a collision box to a room, the entire room is the collision zone.

Make the box from multiple boxes, one per wall. Assign a collision box to each. Or, make your room inside out.



Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 10th Jan 2007 09:45
Thanks for the assistance BatVink! I would never have thought of doing that.

Just out of interest, though, what did you mean you said 'make the room inside out?'

Login to post a reply

Server time is: 2024-11-26 03:32:09
Your offset time is: 2024-11-26 03:32:09