Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Shooting, Killing Enemies, Getting Killed By Enemies, and Score.
- BlueberryMuffin16
-
4 posts
Shooting, Killing Enemies, Getting Killed By Enemies, and Score.
How do I: Kill Enemies, Get Killed By Enemies, and Keep Score? I'm working on a game

- LionB2
-
4 posts
Shooting, Killing Enemies, Getting Killed By Enemies, and Score.
This is a very common mistake - you have to putthe block that says “When (Green flag) Pressed” on every script. If you don't do this, you'll have nothing to sctivate the scripts with.
Another thing you need is the block sorrounding every script, if not they'll only be activated the moment the green flag is pressed, and then dectivated in less than a millisecond. 
Do you understand? Just post and tell me if you need more help!


Do you understand? Just post and tell me if you need more help!
- BlueberryMuffin16
-
4 posts
Shooting, Killing Enemies, Getting Killed By Enemies, and Score.
To LionB2, Thanks! I get it. So, if you can go to that link I posted, (my game) and remix it or reply to this post, that would be great! I'll put you in the credits for the game once I finish it. 

- zillarx
-
1 post
Shooting, Killing Enemies, Getting Killed By Enemies, and Score.
I remixed your game. The scripts I added to the player's sprite should make it easier to move. Also, you might wanna say that for every one enemy killed, it creates a clone of itself so the game keeps going.
- deck26
-
1000+ posts
Shooting, Killing Enemies, Getting Killed By Enemies, and Score.
This is not best practice - if any script is running before the variables it needs have been set the results are unpredictable. That's the most common cause of projects needing the green flag to be clicked twice. This is a very common mistake - you have to putthe block that says “When (Green flag) Pressed” on every script. If you don't do this, you'll have nothing to sctivate the scripts with.Another thing you need is the block sorrounding every script, if not they'll only be activated the moment the green flag is pressed, and then dectivated in less than a millisecond.
Do you understand? Just post and tell me if you need more help!
Much better is to restrict most green flag scripts to do no more than set a costume/position for a sprite and tell it to show/hide. Then have one main green flag script
- ninjianimation
-
1 post
Shooting, Killing Enemies, Getting Killed By Enemies, and Score.
yeah i looked inside and maybe instead of move 10 steps do this
when key pressed
change x by ()
when key pressed
change x by ()
- MTM828
-
500+ posts
Shooting, Killing Enemies, Getting Killed By Enemies, and Score.
There should be a
if an alien dies, that solves the score thing. And reset it if the flag is clicked.
To be honest you should of used clones, using sprites is quite a bad idea, but you seem like you're new so you're unfamiliar with a lot of concepts of Scratch, but to be honest you didn't specify what you want, it's your project so I can't imagine how you'd like the aliens to attack. And that solves everything you asked for, except the spaceship dying part, tell us how you'd like it to be.
Last edited by MTM828 (Sept. 20, 2020 14:57:02)
- deck26
-
1000+ posts
Shooting, Killing Enemies, Getting Killed By Enemies, and Score.
Please check the date before responding. The original question is from 2013 and I don't think clones even existed then. There should be aif an alien dies, that solves the score thing. And reset it if the flag is clicked.To be honest you should of used clones, using sprites is quite a bad idea, but you seem like you're new so you're unfamiliar with a lot of concepts of Scratch, but to be honest you didn't specify what you want, it's your project so I can't imagine how you'd like the aliens to attack. And that solves everything you asked for, except the spaceship dying part, tell us how you'd like it to be.
- MTM828
-
500+ posts
Shooting, Killing Enemies, Getting Killed By Enemies, and Score.
eer.. er.. but ninjaanimation posted then i saw it then.. sorry! but i saw ninjaanimation post so it was on the top of the help with scripts page, so i thought its new.Please check the date before responding. The original question is from 2013 and I don't think clones even existed then. There should be aif an alien dies, that solves the score thing. And reset it if the flag is clicked.To be honest you should of used clones, using sprites is quite a bad idea, but you seem like you're new so you're unfamiliar with a lot of concepts of Scratch, but to be honest you didn't specify what you want, it's your project so I can't imagine how you'd like the aliens to attack. And that solves everything you asked for, except the spaceship dying part, tell us how you'd like it to be.
Last edited by MTM828 (Sept. 20, 2020 17:06:27)
- Discussion Forums
- » Help with Scripts
-
» Shooting, Killing Enemies, Getting Killed By Enemies, and Score.