Hi Guys,
I am making a 'Star Wars - ESCAPE THE DEATH STAR!' Scroller, and obviously i want my Tie-Fighter to fire bullets.
How do I make the bullets fire in the direction that the ship is pointed in?
At the moment I have this script for the ship direction:
<when green flag clicked>
<forever>
<if>
<key[ rightarrow ]pressed?>
<switch to costume[ rightface]
<if>
<key[ leftarrow ]pressed?>
<switch to costume[ leftface]
but how do I get the bullets to fire in the direction of the ship (at the moment they only fire right.
thanks for helping
Offline
Hi Spud1998! First let me point you in the direction of my game called...
Tanks: http://scratch.mit.edu/projects/Sphingo/1900299
... You will find all you want on the sprite called RED SHELL or GREEN SHELL!!!
Let me just explain...
<when green flag clicked>
<broadcast[ e.g. GO ]
Then...
<when I receive[ GO ]
<hide>
<repeat until><key[ space ]pressed?>
<go to[ tiefighter ]
<play sound[ e.g. blast ]
<show>
<point in direction( direction ) of ( tiefighter )
<repeat until><<<touching[ xwing fighter ]<or><touching[ edge of screen etc.] >>
<move( 8 )steps>
<broadcast[ GO ]
This basically means...
That when it says GO make (this is the script of the bullet/blast by the way) bullet hide( so you can't see it) AND FOLLOW AROUND THE TIEFIGHTER. Then if the shoot button is pushed, a noise is made and the bullet made visible The bullet then poinst and moves in the direction of the tiefighter at that time. It will continue to move in that direction until it hits an xwing fighter(for example) or edge of the screen!!!
I STRONGLY SUGGEST YOU CHECK OUT THE SCRIPT FOR THE GREEN OR RED SHELL IN MY TANK GAME!!! IT IS WHAT I HAVE JUST DECRIBED JUST EASIER TO VIEW AND COPY (I don't mind just give me credit!)
I HOPE THIS PROBABLY GIBBERISH HELPS!!! Please reply if it does or doesn't!!!
Offline