This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2008-07-26 05:20:19

bart9032
Scratcher
Registered: 2008-06-16
Posts: 100+

How do you make bullets shoot repeatly one after the other fast?

how do you make it so that bullets shoot repeatly?


Hi, my name is Bartholomew JoJo 'Bart' Simpson. Nice to meet you,
Actually, no I am not Bart Simpson. I am bart9032  cool

Offline

 

#2 2008-07-26 09:55:58

the_guardian
Scratcher
Registered: 2008-03-16
Posts: 98

Re: How do you make bullets shoot repeatly one after the other fast?

You will need to create a seperate sprite for each bullet.   keeping track of which bullet to fire is the tricky part.  I use a local variable in each bullet called status.  If the status =1, the bullet is on screen.  If the status =0, the bullet is not active. When your main sprite fires, you check the status of the bullet sprites and find one that has a status of zero and make that one fire.

I made it sound more complicated than it is.  Check out the game in my signature to see how i did it.

If you have a project started that you need multiple bullets in, give me the link, and i can help you out.

Last edited by the_guardian (2008-07-26 09:57:36)


Guardian 3D!  http://scratch.mit.edu/projects/the_guardian/169865

Offline

 

#3 2008-07-26 15:49:47

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Re: How do you make bullets shoot repeatly one after the other fast?

i just copy the bullet sprite numerous times, and make each bullet fire .2 seconds after the last one.

Offline

 

#4 2008-07-26 16:51:13

the_guardian
Scratcher
Registered: 2008-03-16
Posts: 98

Re: How do you make bullets shoot repeatly one after the other fast?

AlanProjects wrote:

i just copy the bullet sprite numerous times, and make each bullet fire .2 seconds after the last one.

I may have misinterpreted Bart9032's question.  If what you are gonig for is for all the bullets to fire every time then that would work.
If you want to be able to fire multiple bullets, but be able to control how many shots are fired, you need to have some way of determining which bullets are already active.


Guardian 3D!  http://scratch.mit.edu/projects/the_guardian/169865

Offline

 

#5 2008-07-26 17:59:32

newareagle
Scratcher
Registered: 2008-06-10
Posts: 100+

Re: How do you make bullets shoot repeatly one after the other fast?

I would do something like this. Make a single bullet sprite then make it move 10 steps, stamp, move 10 steps, stamp, move 10 steps stamp, clear, repeat until touching x, move -20 steps, stamp, move 10 steps stamp, move 10 steps, stamp, clear. Something along those lines will make it look as if there are 3 bullets moving 10 steps each. Thats the complicated approach.


My Guitar Hero Game.
8/9 Projects on the Front Page at Once!

Offline

 

#6 2008-07-27 00:34:06

bart9032
Scratcher
Registered: 2008-06-16
Posts: 100+

Re: How do you make bullets shoot repeatly one after the other fast?

AlanProjects wrote:

i just copy the bullet sprite numerous times, and make each bullet fire .2 seconds after the last one.

the-guardian wrote:

I may have misinterpreted Bart9032's question.  If what you are gonig for is for all the bullets to fire every time then that would work.
If you want to be able to fire multiple bullets, but be able to control how many shots are fired, you need to have some way of determining which bullets are already active.

Thanks for solving my problem guys


Hi, my name is Bartholomew JoJo 'Bart' Simpson. Nice to meet you,
Actually, no I am not Bart Simpson. I am bart9032  cool

Offline

 

Board footer