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 / Bullets

Author
Message
SFCBias
15
Years of Service
User Offline
Joined: 8th Aug 2009
Location: Hephzibah, GA, USA
Posted: 22nd Sep 2009 05:10
Hi all,

Im trying to handle bullets from a gun, i decided im actually going to move an object in the direction of the player. so my problem is how would i go about creating many objects for bullets. What i have now is i have an object at the players location and angleXYZ and then i call dbCloneObject to create multiple bullets, only problem is if i use that, when ever the player is holding to fire key (and the object is being created) the camera jumps to (0,0) and away from the player object.

Any suggestions on a better way to do this or to fix it will be appreciated.
puppyofkosh
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location:
Posted: 22nd Sep 2009 05:14
I think turning off autocam might do the trick.

try putting dbAutoCamOff(); towards the beginning of your program.
SFCBias
15
Years of Service
User Offline
Joined: 8th Aug 2009
Location: Hephzibah, GA, USA
Posted: 22nd Sep 2009 05:53
so simple of a code, so big of a job. Thanks alot!
puppyofkosh
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location:
Posted: 22nd Sep 2009 13:52
No prob =).
entomophobiac
22
Years of Service
User Offline
Joined: 1st Nov 2002
Location: United States
Posted: 22nd Sep 2009 16:47
I think you're better off using RayCasts or similar stuff for bullets. It's more accurate to calculate a prediction of a bullet than to "throw" an object.

Another method can be to use a "hit cone" projected and rotated with the view of the player and to check for collision whenever you shoot.

But I'd say rays are the fastest and most accurate. Look into the collision library that floats around this forum. Can't remember the name right now. Sparky's?
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 23rd Sep 2009 00:18
Quote: "Look into the collision library that floats around this forum. Can't remember the name right now. Sparky's? "

that is correct:
http://forum.thegamecreators.com/?m=forum_view&t=74762&b=5

Games are like life, they should never stand still.
SFCBias
15
Years of Service
User Offline
Joined: 8th Aug 2009
Location: Hephzibah, GA, USA
Posted: 23rd Sep 2009 22:56
Quote: "I think you're better off using RayCasts or similar stuff for bullets. It's more accurate to calculate a prediction of a bullet than to "throw" an object."


Possibly but the problem is im not quite sure how to use the raycasts

Login to post a reply

Server time is: 2024-11-20 15:23:48
Your offset time is: 2024-11-20 15:23:48