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 / collisilon help.....

Author
Message
Metamophic
21
Years of Service
User Offline
Joined: 23rd Aug 2003
Location:
Posted: 1st Jul 2004 09:35
ok, heres my delimma: i have one object(lets call it "laser") and a bunch of other objects. what i am trying to do, is check if "laser" is colliding with any of the others, and if it is, to delete that particular object. i have tried with a for-next loop, but with no success(look at the source); any suggestions?

www.freewebs.com/metamorphicsoft
dj BlackDragon
21
Years of Service
User Offline
Joined: 23rd Sep 2003
Location: who knows
Posted: 1st Jul 2004 11:33
well i posted something like what you are asking but nobody has answered mine so good luck


Current project:Quest for the Five Staffs of Draconia
Balid
21
Years of Service
User Offline
Joined: 21st Nov 2003
Location: MI, USA
Posted: 1st Jul 2004 12:00
Metamophic,

It may be best (and faster) if you did collision by math.

You know where the objects are, you know how big they are, you know the location of the "laser", so check to see if the location of the "laser" is within the border of your objects.


There may be a better (and faster) way then what I am using but it works very well. If you have trouble make it out, let me know and I'll try to explain it better.

Good luck and I hope this helps.

nuclear glory
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 1st Jul 2004 13:25
I posted in response on the other thread. I'll re-iterate it here:

Our collision system is designed so you need not concern yourself with mathematics. Once you get use to the API a little bit you can setup fairly complex collision scenarios with little effort.

Our page is at:
http://www.nuclearglory.com/ngc.php

And you can also view our thread in the program announcements.

Link is:
http://forum.thegamecreators.com/?m=forum_view&t=20979&b=5

Feel free to ask if you have any questions.

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
JerBil
21
Years of Service
User Offline
Joined: 8th May 2004
Location: Somewhere along the Z axis...
Posted: 1st Jul 2004 13:57
Metamophic,
it may be the long way 'round, but I would put the collision
code for each object in the main loop. I think you'll find it works much better than in a For Next. I have seven collision routines in my program, and they work quite well. Below is a sample, and use variables so you'll know what the objects are.

if object collision(wall_left,ball1) `Detect ball colliding with left wall
d#=90+rnd(30)
yrotate object ball1,d#
pitch object down ball1,p#
play sound 1
endif
Hop a long
21
Years of Service
User Offline
Joined: 12th May 2004
Location: The Code Dump
Posted: 3rd Jul 2004 11:13
Metamophic It is important to see how the Collision code is fitted into the entire program. Here is a short code example that tests for collision with multiple targets. What you are most interested in will be found in the Collision section and the Sub Routine.
http://www.geocities.com/hifin2003/shootin_revisited.html

Login to post a reply

Server time is: 2025-05-24 13:46:37
Your offset time is: 2025-05-24 13:46:37