Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Projectile clone hitting enemy clone...
- Sulooshin
-
8 posts
Projectile clone hitting enemy clone...
Alright guys, I know that this is a very difficult topic, but PLEAAASSEE I need help!
(Also if this is a duplicate, I'm sorry, and can you direct me to the right one?)
Anyway, I'm making a game based off of Genome Guardian, (Look it up if you don't know what it is)
You are a turret and you shoot projectiles at enemies. The enemies and bullets are both clones.
Originally, the bullets dealt 1 damage to the enemies, who had 1 HP. That worked well.
From that, I made enemies have more than 1 HP. That still worked well.
Finally, I attempted to make the bullets do more than 1 damage. That didn't work so well.
I've tried adding a collision manager sprite doing all the work (my current attempt) , I've tried making every bullet calculate it's distance to the closest enemy, and I've tried making every enemy calculate it's distance to the closest bullet.
In the end, none of this worked in a sustainable way.
I have given in and turned to the forums in which I hope to find the answer to this one HORRID problem.
Honestly, I don't care how big the script has to be, but I will make this work.
No matter how complicated, I believe I will be able to fix it with you guys's help.
I appreciate your time in considering this request.
(Oh yeah, I have to put the game link: https://scratch.mit.edu/projects/1218758262/ )
(Also if this is a duplicate, I'm sorry, and can you direct me to the right one?)
Anyway, I'm making a game based off of Genome Guardian, (Look it up if you don't know what it is)
You are a turret and you shoot projectiles at enemies. The enemies and bullets are both clones.
Originally, the bullets dealt 1 damage to the enemies, who had 1 HP. That worked well.
From that, I made enemies have more than 1 HP. That still worked well.
Finally, I attempted to make the bullets do more than 1 damage. That didn't work so well.
I've tried adding a collision manager sprite doing all the work (my current attempt) , I've tried making every bullet calculate it's distance to the closest enemy, and I've tried making every enemy calculate it's distance to the closest bullet.
In the end, none of this worked in a sustainable way.
I have given in and turned to the forums in which I hope to find the answer to this one HORRID problem.
Honestly, I don't care how big the script has to be, but I will make this work.
No matter how complicated, I believe I will be able to fix it with you guys's help.
I appreciate your time in considering this request.
(Oh yeah, I have to put the game link: https://scratch.mit.edu/projects/1218758262/ )
- Lpea42
-
97 posts
Projectile clone hitting enemy clone...
This is a tough game to code! I would look at a tower defense game tutorial and see if that helps. Their engines can calculate projectiles hitting enemies really well so I think it should work similarly in your game as well.
- colinmacc
-
1000+ posts
Projectile clone hitting enemy clone...
I don't really understand what's happening with your “b” variable.
It starts at the length of bullet X, then you're repeating by it, using it as in index for the lists, and finally incrementing it…?
I think that needs looking at.
It starts at the length of bullet X, then you're repeating by it, using it as in index for the lists, and finally incrementing it…?
I think that needs looking at.
- Discussion Forums
- » Help with Scripts
-
» Projectile clone hitting enemy clone...