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 / object collision

Author
Message
admiral davidbell
16
Years of Service
User Offline
Joined: 6th Sep 2008
Location:
Posted: 8th Sep 2008 21:26
Ok I need help with object collisions please use dummy code with this I'm trying to make it simple and organized.Also I'll be adding more objects such as trees and pland I also want collision detection done on.as you see this is gonna be a 3D Rpg with texting so please if you could set up the collision to stop the player character and show text.I could really use the help here
I haven't messed to much with collisions in my own programs before. I'll incude the scorce file so you can see what you're looking at but please if you use the code or models in it alter for your own uses and please don't copy my game.otherwise do as ya like...In any reguards thanks for the time and help,and please don't tell me to look up tutorials,they're not helping,thanks.

Attachments

Login to view attachments
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 8th Sep 2008 22:50 Edited at: 8th Sep 2008 22:55
Hello

Start with the Sliding Collision example. You can find it by typing in to the built in editor of Dark Basic(the one with a black background and white letters) "get static collision hit", then press F1.

You will then come to a search page. There will be a green link at the very bottom of that page. It should say "Sliding collision". Click it, download it to the editor on page 2, and that is the program you should work with.

Study it, copy and paste things from it into your program. That is how I learned it.

The Basics to sliding collision, is to put a collision box around every object(Even the Player):



to detect collision, you use this:



And if you wan`t a first person view, just position the camera at the player object and hide the player object:



And if your looking for a good example for a first person shooter, go to "c:\Program Files\Dark Basic Software\Dark Basic\tutorials\"

You will find lot`s of dba files, each describe step by step how to make an FPS.

Hope that helped!

I you have any questions, or if something isn`t clear, post here and I will happily reply and answer your question.

TheComet

Suicide is away of telling God, You can’t fire me I quit !!!!!
admiral davidbell
16
Years of Service
User Offline
Joined: 6th Sep 2008
Location:
Posted: 9th Sep 2008 22:23 Edited at: 9th Sep 2008 23:23
ok lets try this again already been messing around with the tutorials,and even messed around with the code snippets ya gave me still having runtime errors. here's the code againg,please send suggestions.











attatched is the whole engine.

[Please remember to use code tags - IanM]

Attachments

Login to view attachments

Login to post a reply

Server time is: 2025-06-07 06:49:12
Your offset time is: 2025-06-07 06:49:12