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.

Newcomers DBPro Corner / Problem with 2d space shooter / shooting like machine gun

Author
Message
Adam_db
17
Years of Service
User Offline
Joined: 28th Feb 2007
Location:
Posted: 15th Mar 2007 21:13
Heres my full code:



Im trying to create a machine gun shooting routine, but for some reason, i cant get the bullets to 'Rapid fire' so to speak. this is just my prototype shooter with sprites, then im going to convert everything into objects.

Sometimes when a bullet is fired a second time, the 1st bullet on screen is deleted to.. i dont know why this is happening.
Help someone! please!
thanks.
Adam.

----------------------------------------------------
Just because they are paranoid, doesnt mean they arent out to get you.
Quisco DaLuse
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: USA
Posted: 16th Mar 2007 05:36
Can you post all of the media files? It would help if we could run the code.

You idiots! You've captured their stunt doubles!
Adam_db
17
Years of Service
User Offline
Joined: 28th Feb 2007
Location:
Posted: 16th Mar 2007 15:00
Yes of course, sorry. here are all the sprites. you will probably need to change the extensions. but its all there, i think.

Adam

----------------------------------------------------
Just because they are paranoid, doesnt mean they arent out to get you.

Attachments

Login to view attachments
Adam_db
17
Years of Service
User Offline
Joined: 28th Feb 2007
Location:
Posted: 17th Mar 2007 00:50
I forgot to post a bullet image, any 5x5 .bmp will work though. soz.

----------------------------------------------------
Just because they are paranoid, doesnt mean they arent out to get you.
Quisco DaLuse
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: USA
Posted: 17th Mar 2007 02:53
Adam_db - The answer is that you are only using one sprite for all five bullets. Use five different sprites and it will work. You're going to need to create some sort of delay between firing the bullets, otherwise they will all shoot out at just about the same time. Also, I would change the addBullet subroutine to this:



Some of the media was not there when I downloaded it (the bullet and cylon) so I just made up something so I could run the code.

Good luck with it - it looks promising.

You idiots! You've captured their stunt doubles!

Login to post a reply

Server time is: 2024-11-25 21:39:08
Your offset time is: 2024-11-25 21:39:08