Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Detecting multiple clones at the same time
- DinosaurHotdog
-
11 posts
Detecting multiple clones at the same time
In my game there is a shotgun that fires 3 bullets at a time, each doing 2.5 dmg.
Each enemy has 3 hp, which means 2 bullets from the gun should already kill it BUT beacuse the enemy can only detect IF a bullet is touching it and not HOW MANY bullets are touching it you can fire a hundred bullets at the same time and it would still only take 2.5 dmg.
any fix?
Each enemy has 3 hp, which means 2 bullets from the gun should already kill it BUT beacuse the enemy can only detect IF a bullet is touching it and not HOW MANY bullets are touching it you can fire a hundred bullets at the same time and it would still only take 2.5 dmg.
any fix?
- imFrumpy
-
43 posts
Detecting multiple clones at the same time
try adding this script to every clone:
then add this to the enemy:
if this does not work, please share the project with me! I might be able to help better that way.
then add this to the enemy:
if this does not work, please share the project with me! I might be able to help better that way.
Last edited by imFrumpy (Nov. 20, 2022 16:54:38)
- DinosaurHotdog
-
11 posts
Detecting multiple clones at the same time
try adding this script to every clone:
then add this to the enemy:
if this does not work, please share the project with me! I might be able to help better that way.
Sadly this would not work, the enemies are clones and a broadcast would affect all of them
https://scratch.mit.edu/projects/763358246/ here is the project, switch to the shotgun
it is also worth mensioning that the project is meant to be run in turbowarp with the settings:
-interpolation on
-warp timer on
-infinite clones on
-remove fencing on
-remove miscellaneous limits on
-everything else off
Last edited by DinosaurHotdog (Nov. 20, 2022 17:04:23)
- DinosaurHotdog
-
11 posts
Detecting multiple clones at the same time
Eventually I actually got this working, but instead of using variables I used a list.
Basically every time the shotgun shoots it resets the list and every time the bullet touches the enemy it sets the item 1 of the list to list + 2.5 and every time an enemy touches the bullet, it takes the item 1 of the list or the combined damage and subtracts it from it's health
Basically every time the shotgun shoots it resets the list and every time the bullet touches the enemy it sets the item 1 of the list to list + 2.5 and every time an enemy touches the bullet, it takes the item 1 of the list or the combined damage and subtracts it from it's health
Last edited by DinosaurHotdog (Nov. 25, 2022 21:54:15)
- Discussion Forums
- » Help with Scripts
-
» Detecting multiple clones at the same time