I'm on SFT and I need to know how to spawn projectiles, such as lasers. Spawn as in "place the laser sprite in front of the ship, let it move forward, and animate hit on meteor." Please help.
Offline
Could you be more specific? Are you asking how to shoot?
Offline
Let the laser sprite go to the ship when whatever key pressed. Then let it move 10 steps until it hits the edge or the meteor. On the meteor, make it so that when the laser sprite touches it, it animates. For that, you will have to make different costumes of a meteor exploding and play it when the laser hits.
Offline
Do something like this:
Ship's script
<when green flag clicked>
<forever>
<if> <key[ space ]pressed?>
<broadcast[ shoot ]and wait c>
<end>
<end>
Laser's scripts:
<when green flag clicked>
<hide>
<when I receive[ shoot
<go to[ ship
<point in direction( <direction of [ ship ]>
<move( 10 )steps>
<show>
<repeat until> <touching[ edge
<move( 10 )steps>
<end>
<hide>
Offline
Ok, should there be a variable to tell when the meteor hits it to "turn it off" so I can't hit it until I restart the game?
steppenwulf wrote:
Could you be more specific? Are you asking how to shoot?
Yeah, that's what I'm trying--in a space field. I was being specific; I just didn't tell it in plain English. I guess you could have used something called context clues. 
Last edited by Vista4563 (2009-10-13 06:08:39)
Offline
Please help, I'm trying to help him ASAP through the SFT.
Offline
I mean using the start and stop buttons. Or if my restart button is clicked in the scratch window.
Offline
no, actually the laser can fire multiple times, its the meteors you can only hit once per game.
Offline
http://scratch.mit.edu/projects/Ssbrawl700/699305
This project is for shooting projectiles.
As for meteors exploding you have to tell it to wait until touching a bullet and then make it change to an exploding costume and then hide
Offline
Thanks ssbrawl, great (rushed) project!
Offline