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 / How can i stop something from walking through walls?

Author
Message
Cairne
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: The Internet
Posted: 14th Jul 2004 13:48
Im trying to make a first person shooter, and need help keeping the camera from walking through walls. Also, can anyone tell me an easier way to make walls? My code is a sloppy mess of "Make Box.." codes that take up a lot of space.
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 14th Jul 2004 14:35
Is this in DB Classic or Pro?

If it is DB Classic, you can use static collision boxes where all of the walls are, then use sliding collision on the camera, there is even automatic sliding collision built in.

However, I don't have very much experience in DB Pro. Object collision seems like it would be too slow...

Xander Moser of Bolt Software
Firewall: Your Computer's First Defense - Real Time Strategy game
[href][/href]
Cairne
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: The Internet
Posted: 14th Jul 2004 14:41
I use DB classic, and thanks for the tip.
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 14th Jul 2004 14:49
Yay, DB Classic, now I can help you.

When you create a box for a wall, use the make static collision box command to create an invisible collision box in the exact position as the wall. Do you have experience with sliding collision? If you don't, I can give you an example. If you do, then you should be able to figure it out. There are sliding collision examples that come with DB, take a look at those to figure it out.

Good Luck

Xander Moser of Bolt Software
Firewall: Your Computer's First Defense - Real Time Strategy game
[href][/href]
nuclear glory
20
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 14th Jul 2004 16:30 Edited at: 14th Jul 2004 16:31
A simple sliding collision solution would be to use our collision plugin for DBC. No need to re-invent the wheel as they say

Site at:
http://www.nuclearglory.com/ngc.php

Lead Programmer/Director
Powerful Collision DLL for DBPro and DBC: http://www.nuclearglory.com
Lightwave Scene Exporter to .X also at: http://www.nuclearglory.com
Cairne
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: The Internet
Posted: 14th Jul 2004 17:06
i cant find anything about static collision on my version of darkbasic, and static collision boxes dont seem to do anything.
Hop a long
20
Years of Service
User Offline
Joined: 12th May 2004
Location: The Code Dump
Posted: 15th Jul 2004 11:35 Edited at: 15th Jul 2004 11:37
Collision is cool. There are just so many ways to do it. And the results are great to watch. Here are two simple examples that use sliding collision. They should serve to get you started.
http://www.geocities.com/hifin2003/sliding-collision.html
http://www.geocities.com/hifin2003/jump.html
You can copy and paste the code. There no media files necessary.

Login to post a reply

Server time is: 2024-09-22 16:18:06
Your offset time is: 2024-09-22 16:18:06