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.

Dark GDK / Best way to make bullets

Author
Message
xix psycho xix
16
Years of Service
User Offline
Joined: 15th Sep 2008
Location:
Posted: 16th Sep 2008 21:16
Can anyone possibly give me an example of how to simulate bullets using DarkGDK? I figure that I'll have to use dbIntersectObject, but i have no clue how to set it up
RancidRat
16
Years of Service
User Offline
Joined: 19th Feb 2008
Location:
Posted: 17th Sep 2008 13:09
What exactly do you want to do?
Do you want a bullet flying across the level as the player fires it or do you want it to hit the object that is in the way of the player's aim?
xix psycho xix
16
Years of Service
User Offline
Joined: 15th Sep 2008
Location:
Posted: 17th Sep 2008 16:25
Well, it doesn't really matter. I guess whichever way is the fastest way to make it happen. I tried an object flying across the level kind of thing:



The bullet will fly across the level when the user clicks the left mouse button, and will stop after 300 loops or it collides with the model that i loaded, but this never works. the box just goes right through the object without ever colliding.
RancidRat
16
Years of Service
User Offline
Joined: 19th Feb 2008
Location:
Posted: 18th Sep 2008 18:27
This is the kind of thing I would do; Just paste it and try it, you can move around and use space to shoot:

xix psycho xix
16
Years of Service
User Offline
Joined: 15th Sep 2008
Location:
Posted: 18th Sep 2008 20:28
That's actually pretty much perfect. I'm gonna modify it a little, but its pretty well what i want. How about the other way you were talking about? Like making it simply hit an object in the player's aim?
xix psycho xix
16
Years of Service
User Offline
Joined: 15th Sep 2008
Location:
Posted: 18th Sep 2008 22:48 Edited at: 19th Sep 2008 01:55
I seem to be having a problem using dbObjectHit and dbObjectCollision to detect when a bullet hits. Say i have a monster and am trying to see whether a bullet hit it:



Actually, i got that working now. It was hitting the terrain, but now i can't seem to get it to collide with the monster for some reason. If i post my main loop, can someone tell me what's wrong with it?

Login to post a reply

Server time is: 2024-09-30 05:34:24
Your offset time is: 2024-09-30 05:34:24