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 / Collision detection of enemy bullets with character in FPS

Author
Message
saurabh
6
Years of Service
User Offline
Joined: 17th Apr 2013
Location:
Posted: 17th Apr 2013 14:26 Edited at: 18th Apr 2013 07:24
Hello Friends,
I am developing an FPS game using dark gdk where in i am successful in showing gun fire from enemy side but unable to have collision detection between enemy bullet and character . as collision error appearing both the sides after putting this
saurabh
6
Years of Service
User Offline
Joined: 17th Apr 2013
Location:
Posted: 18th Apr 2013 08:16
Hello friends,
I am developing a FPS in which i am able to achive enemy attack through bullets,but unable to detect collision of bullet with character, in which i need to show health reduction of character

curse
6
Years of Service
User Offline
Joined: 5th Feb 2013
Location:
Posted: 18th Apr 2013 12:40
Where you move bullet?
moveSmoothAtoB() move bullet from player position to enemy position?

I suggest you split the function into two parts. The first, shootBullet() for example, placing the bullet in the initial point and identifies the final position. With dbPickObject() you can check if bullet hit something and depending on the Id returned by the function you act. The second function, instead, updateBulletts(), updates the position of the bullet when this was shot. To check if it collides with something using the function SC_RayCast(). You call shootBullet() only when you shot a bullet (mouse click), while you call updateBullets() for each LoopGDK () cycle.
If you need more information, ask.

Login to post a reply

Server time is: 2019-09-19 19:44:21
Your offset time is: 2019-09-19 19:44:21