Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Clones
- drywaIl
- Scratcher
13 posts
Clones
I'm making a game where you play as a turret and fight zombies with bullets, but I want each zombie to die invidually.
But all the zombies die at once when one gets hit.
Does anyone know how to fix it?
But all the zombies die at once when one gets hit.
Does anyone know how to fix it?
define insecuritycheck (person)
repeat until <[person] = [friend]
go back (100) layers
end
go to front
broadcast [happy]
- deck26
- Scratcher
1000+ posts
Clones
Do they have separate health values? Are you using a broadcast to kill them? Sharing the project and telling us how to replicate the issue makes it far easier to help.
- drywaIl
- Scratcher
13 posts
Clones
Bet, sending now.
define insecuritycheck (person)
repeat until <[person] = [friend]
go back (100) layers
end
go to front
broadcast [happy]
- drywaIl
- Scratcher
13 posts
Clones
define insecuritycheck (person)
repeat until <[person] = [friend]
go back (100) layers
end
go to front
broadcast [happy]
- deck26
- Scratcher
1000+ posts
Clones
The zombies need to detect touching the bullet, you can't just broadcast when the bullet detects the touch. All the zombies get the broadcast and change their own helath value.
So the bullet detects the touch and waits 0 secs to give the zombie time to react and then deletes itself. Similarly the zombie detects teh buttle and changes its health value and waits 0 seconds before checking to see if it is dead..
So the bullet detects the touch and waits 0 secs to give the zombie time to react and then deletes itself. Similarly the zombie detects teh buttle and changes its health value and waits 0 seconds before checking to see if it is dead..
- goosewithnoeggs
- Scratcher
25 posts
Clones
when I start as a cloneClone ID has to be set to for this sprite only.
change [Clones] by (1)
set [Clone ID] to (Clones)
add [Max HP] to [Zombie HP v]
repeat until <(item (Clone ID) of [Zombie HP v] :: list) < [1]>
Zombie Ai
if <touching [Bullet v] ?> then
replace item (Clone ID) of [Zombie HP v] with ((item (Clone ID) of [Zombie HP v] :: list) - (1))
end
end
Set the variables to 0 at the beginning and delete all of the list.
if <[Making A Dumb Mistake] = [True]> thenCheck out my stuff I do math stuff and simple animations - Goose
set [Emotion] to [Confused]
ask [Please Correct Me] and wait
else
set [Emotion] to [Happy]
end
I guess I'm here too - Audrey
.
- deck26
- Scratcher
1000+ posts
Clones
No need for a list, the zombies already have a local variable.when I start as a cloneClone ID has to be set to for this sprite only.
change [Clones] by (1)
set [Clone ID] to (Clones)
add [Max HP] to [Zombie HP v]
repeat until <(item (Clone ID) of [Zombie HP v] :: list) < [1]>
Zombie Ai
if <touching [Bullet v] ?> then
replace item (Clone ID) of [Zombie HP v] with ((item (Clone ID) of [Zombie HP v] :: list) - (1))
end
end
Set the variables to 0 at the beginning and delete all of the list.
- drywaIl
- Scratcher
13 posts
Clones
ty
define insecuritycheck (person)
repeat until <[person] = [friend]
go back (100) layers
end
go to front
broadcast [happy]
- Discussion Forums
- » Help with Scripts
- » Clones