Pages: 1
Topic closed
I learned this from I forget who:
[blocks]<when green flag clicked>[blocks]
[blocks]<forever>[/blocks]
[blocks]<if><key[ Space ]pressed?>[/blocks]
[blocks]<point towards( Gun[/blocks]
[blocks]<repeat until><touching[ Edge[/blocks]
[blocks]<move( 10 )steps>[/blocks]
[blocks]<end>[/blocks]
[blocks]<hide>[/blocks]
You can also try [blocks]<point in direction( <direction of Gun[/blocks]
Offline
Ok, so you have two sprites. the shooter and the bullet.
Shooter: this is your tank, airplane, slingshot etc... you may want it to move or rotate.
Bullet: this will appear to shoot from the shooter.
it will be invisable till it's ready, (hide)
when the trigger button is pressed (space will work) it moves to where the shooter is.
It changes it's rotation to the rotation of the shooter.
use "show" to make it visable.
then it moves forward until it hits something, like the color of an enemy.
also when it hits, it changes it's costume to an explosion then hides again, ready to shoot again.
That's the gist of how I do it. http://scratch.mit.edu/projects/AddZero/126604
Bluestribute's code has some of that, and may be a good start.
Offline
uhh.. bluestribute i tried your suggestion and it doesn't work try this...
For bullet:
When I receive Fire
Go to shooter
Point in direction direction of player 1
Show
Forever
Move 10 steps
If touching edge
hide
stop script
For shooter:
When key space pressed
Broadcast Fire
Offline
Topic closed
Pages: 1