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.

2D All the way! / Shooting 2D bullets

Author
Message
BigE
19
Years of Service
User Offline
Joined: 27th Sep 2006
Location:
Posted: 30th Sep 2006 22:19
I'm trying to create a simple 2d space shooter. I'm having trouble with shooting part. My ship only shoots one bullet at a time. When I try and shoot again it erases the first bullet. How can I have repeating bullets? Is there a simple way? For some reason, I'm having trouble learning and using sprite arrays. Also when I shoot using mouseclick(1), everything freezes until I release the mouse button. I'm using DBPRO.
Zergei
21
Years of Service
User Offline
Joined: 9th Feb 2005
Location: Everywhere
Posted: 1st Oct 2006 05:59
Code will help a lot. and probably why the bullet erases is that you reset its coordinates, when you should actually create a new bullet, and once it disapears due to a hit or going off screen, then re-use it.
Thats why some games you can shoot a limit numbers of shoots and in others not (some space invader you can shoot only 1 bullet at a time, however in games such as megaman many bullets can be shoot, either infinite or 4).

Further on my stuff at...
BigE
19
Years of Service
User Offline
Joined: 27th Sep 2006
Location:
Posted: 1st Oct 2006 07:27
Here is the code that I've got so far.
Roxas
20
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 2nd Oct 2006 21:42


Try this.. i not 100% sure does it work because havent tested.. if it gives error tell me.

BigE
19
Years of Service
User Offline
Joined: 27th Sep 2006
Location:
Posted: 2nd Oct 2006 23:17
Thanks for the help, but it still didn't work. Whenever the ship fires the missile doesn't move. It's a step in the right direction because now at least there is more than one missile. I've been working on this one problem now for two weeks. Here is my media folder, I would appreciate it if you have a look at it. Maybe you can get it to work.
Zergei
21
Years of Service
User Offline
Joined: 9th Feb 2005
Location: Everywhere
Posted: 3rd Oct 2006 19:27
How about this...



Hope it helps...

Further on my stuff at...
BigE
19
Years of Service
User Offline
Joined: 27th Sep 2006
Location:
Posted: 4th Oct 2006 01:42
Thanks Z,
That is exactly what I was looking for. Now I'll study your code and see what I was doing wrong. Thanks again.
2D Analyst
AGK Developer
22
Years of Service
User Offline
Joined: 2nd May 2004
Location:
Posted: 23rd Oct 2006 22:02
I remember couple of years back..I was having the same problem with the single bullet shooting. lolz

www.simpoware.com
BiggAdd
Retired Moderator
21
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 31st Oct 2006 01:55
I made this ages ago... i dunno if it will help:

Link!

Ryaaannn
19
Years of Service
User Offline
Joined: 12th Dec 2006
Location:
Posted: 12th Dec 2006 13:45
Just started 1st year of programming at uni, me and my friend having trouble with the bullet array as we want to fire numerous bullets at the same time, instead of waiting till the first one is deleted to fire again.

Has anyone got any examples for us to look at? It would be appreciated, thanks

Login to post a reply

Server time is: 2026-07-05 04:45:05
Your offset time is: 2026-07-05 04:45:05