Hello,Brass45 here,and I need help making an AI machine gun for scratch(I'm making a terminator-spoof type game).I know to use multiple sprites and a variable to control when they fire,and it works just fine with a "mouse down" command,but as soon as soon as I use a "When I Recieve"command,the variable changes,but only one bullet comes out!Please help Immediatly!Here are the scripts I used.Thanks.
<when green flag clicked>
<forever>
<wait(1 )secsc>
<if><( <pick random( 1 )to(10) <=>10 )>
<repeat( 12)>
<broadcast[ fire]>
<wait( 0.1 )secsc>
<when I receive[ fire]>
<if><( <{ shoot }> <=>so-so )>
<wait( 0.1)secsc>
<set{shoot }to( so-so)>
<go to[ gun]>
<point in direction(direction of gun) >
<repeat until><touching[ edge]>
<move( 10 )steps>
Note:I mean a 2-D fighting game,not a first-person shooter.
Last edited by Brass45 (2009-09-11 07:59:29)
Offline
All I can suggest is looking through M44's stuff... here's the link: M44's stuff
Offline
Try using Broadcast And Wait instead of Broadcast. Broadcast And Wait will wait until the scripts that are triggered by it are complete before moving on to the next block.
Offline
That works okay,but the gun would be Semi-Automatic because you would need to wait until the bullet hit the edge for the next one to fire.I could make it work,though.
Last edited by Brass45 (2009-09-11 09:19:13)
Offline