Hey!
I'm making a platform shooting game that involves using the mouse for aiming.
For example: When I move the mouse upwards the gun will point in that direction.
But my question is, how do I make it so the bullet fires in that direction also. I have tried it and it half works. However, when ever I move the mouse again, the bullet follows it.
So what I really want is for the bullet to fire in the direction of the mouse and not change direction again.
This is what I've got:
<when I receive[ shoot1]>
<forever if><< <not> touching[ enemy1 ]>
<repeat until><touching[ enemy1 ]>
<show>
<point towards( mouse pointer)>
<glide( 1 )secs to x <mouse x> )y <mouse y> )
<if><touching[ enemy1 ]>
<hide>
<broadcast[ death ]>
Note: the bullet is a seperate sprite.
Last edited by Dan01 (2008-06-16 15:13:34)
Offline
Easy. Don't repeat the point towards mouse pointer. So it's like this:
[blocks]<when I receive[ shoot[/blocks]
[blocks]<point towards( mouse pointer[/blocks]
and then the rest of the script
Offline
Tutorial_Maker wrote:
Easy. Don't repeat the point towards mouse pointer. So it's like this:
[blocks]<when I receive[ shoot[/blocks]
[blocks]<point towards( mouse pointer[/blocks]
and then the rest of the script
Thanks!
However, it stops when the bullet reaches where the mouse was at the point of firing. Is there a way to make it continue firing in that direction?
~ Dan01
Offline
Don't do the glide to mouse X/Y. instead, use the [blocks]<move( 10 )steps>[/blocks] block
Offline
No problem
Offline