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

#1 2010-09-11 14:30:28

Cannible89
New Scratcher
Registered: 2010-09-11
Posts: 4

How to Shoot ?

Ok, so I got all the sprites sorted out and I want the gun to shoot when I click, but the only options I've got are when (flag) is pressed, when I press space etc. and when sprite ... is pressed, but there's no, when mouse is clicked help would be greatly appreciated. [blocks]<when green flag clicked>[/blocks] [blocks]<when[  ]key pressed>[/blocks] [blocks]<when[  ]clicked>[/blocks]

Offline

 

#2 2010-09-11 15:06:18

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: How to Shoot ?

Use the "when flag clicked block"  then use the sensor block for "mouse down?"


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#3 2010-09-11 15:47:30

Cannible89
New Scratcher
Registered: 2010-09-11
Posts: 4

Re: How to Shoot ?

Yep thanks =] but, now when i press it down i've got it to subtract 1 bullet but it takes away about tree or four. What should i do ?
[blocks]<when green flag clicked>[/blocks][blocks]<set{ bullets }to( 50 )[/blocks][blocks]<forever if>[/blocks][blocks]<mouse down?>[/blocks][blocks]<change{ bullets }by ( -1 ) [/blocks]<point towards( mouse Pointer) [blocks]<glide( 0.3 )secs to x sad  mouse X )y sad  Mouse Y ) [/blocks]

Offline

 

#4 2010-09-11 16:05:21

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: How to Shoot ?

Put a "wait until not mouse down" blocks into the if mouse down script


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#5 2010-09-11 16:25:55

melikecheese
Scratcher
Registered: 2010-06-09
Posts: 500+

Re: How to Shoot ?

http://i56.tinypic.com/2d1q0aw.jpg


http://i51.tinypic.com/987rb5.jpg
I am Dave! Yognaught.

Offline

 

#6 2010-09-11 16:35:14

Cannible89
New Scratcher
Registered: 2010-09-11
Posts: 4

Re: How to Shoot ?

Thank yoouuuuu =]]

Offline

 

#7 2010-09-11 21:33:45

Cannible89
New Scratcher
Registered: 2010-09-11
Posts: 4

Re: How to Shoot ?

ok, last thing i have to do. I have a moving target trying to get over to the other side, and when i shoot it, it has to restart in its position. But when i shoot it, it messes up and keeps spazzing out and flickering but not getting reset just flickering closer to where its trying to go help ?
<when green flag clicked>
<go to x sad  264 )y sad  -28 )
<show>
<switch to costume[ 1 ]
<glide( 5 )secs to x sad  -236 )y sad  120)
<forever if><touching[ Sprite 4 ]
<change{ health  }by( -10 )
<go to x sad  264 )y sad  -28  )
<wait( 1 )secsc>
<glide( 5 )secs to x sad  236 )y sad  -120 )
<when green flag clicked>
<forever if><touching[ sprite 2 ]
<change{ kills  }by( 1 )
<switch to costume[ <pick random( 2 )to( 4 )
<wait( 1 )secsc>
<hide>
<go to x sad  264 )y sad  -28 )
<switch to costume[ 1 ]
<show>
<wait( 1 )secsc>
<glide( 5 )secs to x sad  -236 )y sad  120  )

Offline

 

Board footer