I need help with my game. I am trying to make the marksman move but I don't know how to make the bullet start up to follow him. Download the project to see what I mean. Sprite 2 is at the end of the gun and sprite 3 (the bullet) 's script says when space pressed to go to sprite to and glide to a certain area. If you think you can help me please do. Thanks .
Offline
adriangl wrote:
I need help with my game. I am trying to make the marksman move but I don't know how to make the bullet start up to follow him. Download the project to see what I mean. Sprite 2 is at the end of the gun and sprite 3 (the bullet) 's script says when space pressed to go to sprite to and glide to a certain area. If you think you can help me please do. Thanks
.
I haven't downloaded it because, if you explained it correctly, use the repeat until block, like this:
[blocks]<repeat until><< <touching[ edge <or> <touching[ enemy >>[/blocks]
[blocks]<move( 10 )steps>[/blocks]
[blocks]<end>[/blocks]
[blocks]<hide>[/blocks]
Offline
Easy, I just did this with my game.
<when green flag clicked>
<forever><go to x (( x of sniper <+> * )) )y
(( Y of Sniper <+> * ))
<if><key[ space ]pressed?>
<repeat( 40 )
<change x by( 10 )
<if><touching[ Target]
<broadcast[ Hit]
<hide>
<end>
<end>
<end>
* To get this number, Put the sniper in the shooting costume. Then place the bullet where you want it to come out. Do the snipers x- the bullets X. You have that number. IF the guy is pointing 90 dergrees, make it positive. If pointing -90 degrees, make it negative. Do the same for the y.
Hope this works for ya!
Offline