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 / Need help with collision

Author
Message
Blazer
22
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: United States
Posted: 24th Feb 2003 03:42
I'm using the static collision code in the DB tut, but is there a way to say:

if you hit this box then do something,

just 1 specific box, not all of them, thx
As I walk through the vally of the shadow of death, I will fear no evil.
- Psalms 23:4
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 24th Feb 2003 04:23
First thing I would do is make a collision box then if the walls of the box are at a certain position then do your collision code. Its mostly using OBJECT POSITION and stuff.

RPGamer

Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy!
QuothTheRaven
22
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 24th Feb 2003 05:21
blazer, I would highly recommend against static collision. I would go to the SLIDING COLLISION examples in the help files, and grab the collision code from the sliding collision example. Then, to find the number of the object you are colliding with:

object = object collision(1,0)

assuming you are object 1, the variable OBJECT will be the number of the box you are colliding with. And if you knew that your wall was wall 16, you could say

if object=16 then this is a wall

hope that helps

Darken the skies, we are God.

Login to post a reply

Server time is: 2025-05-15 16:55:17
Your offset time is: 2025-05-15 16:55:17