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 Professional Discussion / Problems with bullet collision...

Author
Message
MasterInsan0
23
Years of Service
User Offline
Joined: 14th May 2003
Location: United States
Posted: 18th Jun 2003 19:49
Well after all my questions and newbie-ness, I have finally created bullets! And they actually fly at the crosshair! But now I seem to be having trouble getting them to actually collide.

I am setting the collision on for both the level's objects and the bullets upon creation, and then twice in the loop I check for collision (before new bullets can be made and afterwards). I attached my gun and bullet control code. For those looking through my code, objects 27 through 85 are the level's shootable objects.

Also, you'll noticed I have commented out the gun's animation. DBPro won't load the gun and I was wondering if there is a problem with Milkshape 3D 1.6.4's .x exporter? If there is, are there any free or trial (but non-limited) programs that can export and import .x?
MasterInsan0
23
Years of Service
User Offline
Joined: 14th May 2003
Location: United States
Posted: 18th Jun 2003 22:57
Anyone have any ideas or suggestions?
MasterInsan0
23
Years of Service
User Offline
Joined: 14th May 2003
Location: United States
Posted: 19th Jun 2003 00:25
Please?
madcaddy
23
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 19th Jun 2003 02:07
ok the best way ive seen is to move the bullet with a for/next loop as soon as the gun is fired - check for collisions after each move. just make sure you dont sync until uve finished the loop. this will give 'instant bullets' which are generally fast and reliable. hope this is of some help!
kevil
23
Years of Service
User Offline
Joined: 24th Nov 2002
Location: Netherlands
Posted: 19th Jun 2003 03:24
I suggest you look into the "intersect object" command. It's made for things like this.

Kevil

Misanthrope
23
Years of Service
User Offline
Joined: 31st Jan 2003
Location:
Posted: 19th Jun 2003 05:43
This may help you. The code's for DBC, but the principle is the same. Scroll down to my post with the pseudocode, it deals with making sure bullets or any other fast moving objects actually register collisions properly.

http://www.darkbasicpro.com/apollo/view.php?t=11974&b=7

-Misanthrope

Login to post a reply

Server time is: 2026-07-11 14:55:27
Your offset time is: 2026-07-11 14:55:27