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 / Shooting multiple bullets

Author
Message
zydeoN
15
Years of Service
User Offline
Joined: 25th Sep 2009
Location:
Posted: 15th Nov 2009 14:07
So, i am making a FPS game, and kind of a paintball game. So, i wanted to see the multiple bullets, moving around... I created a shpere (bullet). Then i used dbCloneObject() and dbTimer() to update the time, and to clone the bullet each 0,2 seconds... The problem is that each time the bullet is cloned to a new shpere, gives me a bug with the camera... So i wanted to know if does anyone know other method besides this one.
Another problem i am having is that i am using the function dbMoveObject(i, speed) to move the bullets. So each time the bullet is cloned, the i variable increments (i++), accordingly to the id of the objects cloned. But this way, if a bullet A is cloned to a bullet B, the i increments, so the bullet B is the only one moving around.
Can anybody help me ?
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 15th Nov 2009 15:14
Every time when you create a new object, the camera moves to show the new object. You can switch this behaviour off by dbAutoCamOff().

Of course you can't move several objects with only one object ID. You have to keep track of the ID numbers of all created objects (range of ID numbers, or an array) and then write a loop to move all of them.
zydeoN
15
Years of Service
User Offline
Joined: 25th Sep 2009
Location:
Posted: 15th Nov 2009 15:49
Thanks Mireben, great help ! The dbAutoCamOff() works and just did a for loop to move all the bullets.

Login to post a reply

Server time is: 2024-11-20 09:15:33
Your offset time is: 2024-11-20 09:15:33