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

#1 2008-02-14 22:00:47

lilhd
Scratcher
Registered: 2007-12-03
Posts: 26

Making a "machine gun" shoot multiple bullets with one bullet

How could you make something like a machine gun shoot multiple bullets one after another with only using 1 sprite for the bullet. Is there a way? I dont care if its complicated or not just tell me if its possible. Thanks

Offline

 

#2 2008-02-14 22:55:57

FPSFelix
Scratcher
Registered: 2008-02-06
Posts: 100+

Re: Making a "machine gun" shoot multiple bullets with one bullet

not as far as i know.
maybe w/ some really complicated script set using the stamp thing.
but not anyway simple at least.


this is what i brought you, this you can keep.
this is what i brought, you may forget me.
i promise to depart, just promise one thing...
kiss my eyes and lay me to sleep.

Offline

 

#3 2008-02-15 01:02:12

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: Making a "machine gun" shoot multiple bullets with one bullet

if there were all to go in the same direction and were equally spaced, you could concievably do something with costumes to make it look like more than one bullet, but otherwise, no - every independent object on screen will need its own sprite


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#4 2008-02-15 17:55:12

bcbrendan
Scratcher
Registered: 2008-02-15
Posts: 1

Re: Making a "machine gun" shoot multiple bullets with one bullet

I know

Offline

 

#5 2008-02-18 20:30:28

oooo
Scratcher
Registered: 2007-08-09
Posts: 20

Re: Making a "machine gun" shoot multiple bullets with one bullet

Make one sprite with a costume with multiple bullets.  Or just make many sprites.

See Restricted Airspacev1.0 or Restricted Airspacev2.0 for examples.  (oooo's stuff.)

Offline

 

#6 2008-02-20 20:23:37

oooo
Scratcher
Registered: 2007-08-09
Posts: 20

Re: Making a "machine gun" shoot multiple bullets with one bullet

In response to your comment on my project:
     For the basic ammo, I have two sprites.  Each sprite's costume shows two bullets.  When space is pressed, one sprite (two bullets) is shot.  When it is held, the other sprite also is shot.  But notice that there is only ever a maximum of four bullets-two from each sprite.  The plane cannot shoot until one of the sprites finishes its trajectory after being shot.  try downloading the project and looking at the plane's script for shooting- it should have shoot broadcasts separated by wait blocks (so that it waits for the earlier shot to hit the edge of the screen before reusing it)

Your machine gun problem is one that I have noticed on scratch.  You have to program almost every single bullet.  To make your gun, I would reccomend making a single bullet sprite and copying it many times, programing each copy to shoot a moment after the precious.  That is, have the second bullet wait .1 seconds before begining its script, have the third wait .2, etc.  There is really no easy way to have many bullets in scratch.  The best you can do is to have many sprites and to have them be reussed after they hit an enemy or exit the screen.

Offline

 

#7 2008-02-21 17:35:51

Rummy
Scratcher
Registered: 2007-08-12
Posts: 14

Re: Making a "machine gun" shoot multiple bullets with one bullet

[blocks]    <when green flag clicked>
               <forever>
              <show>
             <glide(  )secs to x sad   )y sad  )
              <hide>
               <go to[ gun ]>
               <end>
              [/blocks]

Last edited by Rummy (2008-02-21 17:37:08)

Offline

 

#8 2008-02-21 17:38:35

Rummy
Scratcher
Registered: 2007-08-12
Posts: 14

Re: Making a "machine gun" shoot multiple bullets with one bullet

thats the script for shooting a bullet:)
(tell me if i'm missing somthing here)

Offline

 

#9 2008-02-22 00:35:24

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: Making a "machine gun" shoot multiple bullets with one bullet

Insteda of glide, I usually use:

Point in direction (main sprite direction)
Repeat until touching edge
>>Move 10
>>Wait 0.05


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#10 2008-07-13 02:22:40

zurich
Scratcher
Registered: 2008-01-26
Posts: 9

Re: Making a "machine gun" shoot multiple bullets with one bullet

I made a scratche project fairly fast called "Making a "machine gun" shoot multiple bullets with one bullet" it shoots one bullet and looks like about 6 you can use it for everything you want feel free to download it its fairly simple too! No mind blowing equations:)

Offline

 

#11 2008-07-13 02:39:14

zurich
Scratcher
Registered: 2008-01-26
Posts: 9

Re: Making a "machine gun" shoot multiple bullets with one bullet

look at my second one the project with the Ak47 its awsome:)

Offline

 

#12 2008-07-13 12:41:30

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: Making a "machine gun" shoot multiple bullets with one bullet

Mayhem wrote:

Insteda of glide, I usually use:

Point in direction (main sprite direction)
Repeat until touching edge
>>Move 10
>>Wait 0.05

It looks better if you take away the wait and change the move steps to you liking. And if you made a good use of variables, you can use the stamping. Or in a game I am making, I wanted to do this to, so I used a costume for the gun, and a little math about the directions to make them hide (I used 183 for the sum/difference if you wanna try something like this. Like for if it has a positive X coordinate, it would be direction of gun-direction (or 

(( Direction of gun <-> <direction>  ))

And reversed for a negative X (direction minue direction of gun)


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#13 2008-07-13 12:52:11

bigB
Scratcher
Registered: 2007-06-09
Posts: 100+

Re: Making a "machine gun" shoot multiple bullets with one bullet

Mayhem wrote:

no - every independent object on screen will need its own sprite

it may actually be possible to do using stamping so that one sprite acts like many.  this would not be ideal though as it is likely to be more stuttery and fairly complex.


http://scratch.mit.edu/projects/bigB/260981 Draw to Text
http://scratch.mit.edu/projects/bigB/181829 3D Stunt Flyer

Offline

 

#14 2008-07-13 14:44:02

zurich
Scratcher
Registered: 2008-01-26
Posts: 9

Re: Making a "machine gun" shoot multiple bullets with one bullet

would anyone look at my project called "Making a "machine gun" shoot multiple bullets with one bullet" it hink it may be what you want !!!

Offline

 

#15 2008-08-30 06:24:14

luiG
Scratcher
Registered: 2008-06-29
Posts: 5

Re: Making a "machine gun" shoot multiple bullets with one bullet

lilhd wrote:

How could you make something like a machine gun shoot multiple bullets one after another with only using 1 sprite for the bullet. Is there a way? I dont care if its complicated or not just tell me if its possible. Thanks

just make alought of costumes. it is simple=)

Offline

 

#16 2008-08-30 12:16:11

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: Making a "machine gun" shoot multiple bullets with one bullet

My Tank game might (dunno if I uploaded the effect) be a good example. If I did upload it, I made it seem like a bunch were shooting using stamp/clear blocks


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#17 2008-08-30 13:13:44

zawicki1fromyoutube
Scratcher
Registered: 2008-07-31
Posts: 1000+

Re: Making a "machine gun" shoot multiple bullets with one bullet

lilhd wrote:

How could you make something like a machine gun shoot multiple bullets one after another with only using 1 sprite for the bullet. Is there a way? I dont care if its complicated or not just tell me if its possible. Thanks

You can do it with any bullets. first, go to the sprite in his shooting position (without his bullets) and hit copy. now edit the sprite, and draw or import the sprite of you bullet(s) in the picture.


|Call Of Duty: Black Ops Wii Friend Code: 3519-4456-0013|
|Follow me on Twitter|Subscribe To My Youtube Channel

Offline

 

#18 2008-08-30 14:51:35

dingdong
Scratcher
Registered: 2007-08-09
Posts: 1000+

Re: Making a "machine gun" shoot multiple bullets with one bullet

this only happens in other programming languages that can duplicate sprites while running


http://img851.imageshack.us/img851/2829/superanbanner.png
click the image for my music

Offline

 

#19 2008-08-30 15:12:27

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: Making a "machine gun" shoot multiple bullets with one bullet

On the Stage:

When flag clicked:
Set bulletCount to 0
Broadcast countBullets and wait
//start game with next broadcast
Broadcast startGame

//space to shoot
When I receive startGame
set bulletCall# to 1
Forever
  If (key space pressed?) and (bulletsAvaliable>0)
    change bulletCall# by 1
    if bulletCall#>countBullets
      bulletCall#=1
    endIf
    broadcast callBullet
  endIf

   
             
EndForever

Create a bullet sprite with the following code, then copy as many times as you'd like:

When I receive countBullets
change countBullets by 1
set myBullet# to countBullets
//myBullet# is a local variable, each bullet has its own

When I receive callBullet
if bulletCall#=myBullet#
change bulletsAvaliable by -1
//Do the shooting script here
change bulletsAvalaible by 1
endIf

Tell me if this works, since I'm not quite sure. Or look at this project.

Last edited by fullmoon (2008-08-30 15:15:29)


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#20 2008-09-04 18:41:07

luiG
Scratcher
Registered: 2008-06-29
Posts: 5

Re: Making a "machine gun" shoot multiple bullets with one bullet

dude go to this link and download the game and look at the scriptsand costume to make a pack of ammo. smile  http://scratch.mit.edu/projects/luiG/237577

Offline

 

#21 2008-09-04 18:58:58

blazinx
Scratcher
Registered: 2008-09-03
Posts: 6

Re: Making a "machine gun" shoot multiple bullets with one bullet

This would be useful in a multiplayer game. Or actually any shooter game.


Blazinx was here  big_smile  ..............I think.

Offline

 

#22 2009-03-30 06:04:19

Asimo
Scratcher
Registered: 2009-03-20
Posts: 21

Re: Making a "machine gun" shoot multiple bullets with one bullet

Mayhem wrote:

Insteda of glide, I usually use:

Point in direction (main sprite direction)
Repeat until touching edge
>>Move 10
>>Wait 0.05

Im not sure which blocks to use for the "repeat until touching edge"
can you please use the blocks to show me

Last edited by Asimo (2009-03-30 06:08:14)


Sdrawkcab Era Seye Rouy Siht Daer Nac Ouy Fi

Offline

 

#23 2009-03-30 12:39:08

yambanshee
Scratcher
Registered: 2007-11-06
Posts: 500+

Re: Making a "machine gun" shoot multiple bullets with one bullet

Asimo wrote:

Mayhem wrote:

Insteda of glide, I usually use:

Point in direction (main sprite direction)
Repeat until touching edge
>>Move 10
>>Wait 0.05

Im not sure which blocks to use for the "repeat until touching edge"
can you please use the blocks to show me

<repeat until><touching[ edge

Offline

 

#24 2009-08-11 14:22:41

AGXgames
Scratcher
Registered: 2009-07-29
Posts: 1

Re: Making a "machine gun" shoot multiple bullets with one bullet

smile  I think you could draw one bullet then etit the costume and stamp it. ?  smile

Offline

 

#25 2009-08-23 19:07:15

Marine43753
Scratcher
Registered: 2008-08-25
Posts: 16

Re: Making a "machine gun" shoot multiple bullets with one bullet

This is easy!! =~D just go to http://scratch.mit.edu/projects/Marine43753/657539(this)
project by me,(p.s. I know that the dynamics ar'nt there yet but the shootings fine.)
Download it and use that script for the bullets. And I know the shootings * online
but when you download it it works fine.

Offline

 

Board footer