Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Bloons Tower defence type of game.
- stevessy
-
16 posts
Bloons Tower defence type of game.
So, I have an enemy tank which will glide along a small road. A turret will shoot said tank with a cloned bullet. I have the variables “lives” and “Score” and lives is supposed to minus by 1 and and score should be plussed by one. How would one go about this? (If you put code, try to put notes on so I can understand better for future. Thanks!
- deck26
-
1000+ posts
Bloons Tower defence type of game.
It's always easier if you share a project.
Essentially you must have something that tells you the bullet has hit the tank - perhaps the bullet detects this.
Essentially you must have something that tells you the bullet has hit the tank - perhaps the bullet detects this.
You may also want to delete the clone when it touches the edge of the screen without affecting lives or score.
- stevessy
-
16 posts
Bloons Tower defence type of game.
I did what you said for the bullet, how do I make it so the tank clone disappear?, I shared the test project but something went wrong on the third tank… It's always easier if you share a project.
Essentially you must have something that tells you the bullet has hit the tank - perhaps the bullet detects this.You may also want to delete the clone when it touches the edge of the screen without affecting lives or score.
Last edited by stevessy (Nov. 17, 2015 14:24:14)
- deck26
-
1000+ posts
Bloons Tower defence type of game.
If the tanks are clones as well as the bullets it's a bit more complicated but I think as long as you allow time for the tank to detect the bullet as well as vice versa you can get them both to delete themselves.
Your problem with the tanks is that clones go back to the start and repeat their path because the script with the glides is looping.
Your problem with the tanks is that clones go back to the start and repeat their path because the script with the glides is looping.
- stevessy
-
16 posts
Bloons Tower defence type of game.
It doesn't really matter anymore, I gave up on the project. If the tanks are clones as well as the bullets it's a bit more complicated but I think as long as you allow time for the tank to detect the bullet as well as vice versa you can get them both to delete themselves.
Your problem with the tanks is that clones go back to the start and repeat their path because the script with the glides is looping.
- Discussion Forums
- » Help with Scripts
-
» Bloons Tower defence type of game.