I'm trying to make a game that require's you to stop balls from hitting a central block, and i need to know how to make a sprite shoot another sprite, e.g. a gun is one sprite and the bulet is another. Any ideas on how to do this?
Offline
you need lots of bullet sprites and a variable called bullets. Then make a script like this:
<when[ fire ]key pressed>
<if><( total number of buller sprites <>><{ bullets }> )>
<change{ bullets }by( 1
<broadcast[ fire ]and wait c>
<end>
in each of the bullet sprites, it will have a personal variable called bullet id
<when I receive[ fire
<if><( <{ bullets }> <=> <{ bullet id }> )>
<go to x (x position) of (gun) )y
(y position) of (gun)
<show>
<wait until><touching[ a srite which stops bullets
<hide>
<broadcast[ hit wall ]and wait c>
<end>
Also, this belongs in all about scratch.
Offline
Thats helpful, but not quite what im after, I should have been clearer. The gun needs to fire automaticly, The placer defends against them. Also, the gun is moving fast, so i cant use the [blocks]<go to x )y
[/blocks].
Offline