Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Clone Costume detection
- BaldiVsPacmanEtc
-
Scratcher
19 posts
Clone Costume detection
Hi! I have a bomb attack in my game, and when it explodes, it changes its costume. The player can parry the bombs midair, but if it lands, I want to make it so it can damage the player. Anyone know how to do this? The project WIP is https://scratch.mit.edu/projects/768581281/ . Thanks! For the record, it's the fact I want it to detect if the player is touching a clone and that the clone's costume is one of the exploding costumes.
- geek62
-
Scratcher
100+ posts
Clone Costume detection
There is a block to tell you if this sprite is touching some other sprite, but it does not distinguish between that other sprite and its clones - they all count as that kind of sprite.
Probably the easier thing to do is have the clones test for touching the player sprite, and when they touch, broadcast an event that the player sprite could react to. And the clone could check its own costume and only broadcast that event if it was exploding.
Probably the easier thing to do is have the clones test for touching the player sprite, and when they touch, broadcast an event that the player sprite could react to. And the clone could check its own costume and only broadcast that event if it was exploding.
- BaldiVsPacmanEtc
-
Scratcher
19 posts
Clone Costume detection
There is a block to tell you if this sprite is touching some other sprite, but it does not distinguish between that other sprite and its clones - they all count as that kind of sprite.Ah, ok! That should work perfectly, I sometimes forget that you can have multiple lines of
Probably the easier thing to do is have the clones test for touching the player sprite, and when they touch, broadcast an event that the player sprite could react to. And the clone could check its own costume and only broadcast that event if it was exploding.
when I start as a clone
Thank you!
- Discussion Forums
- » Help with Scripts
-
» Clone Costume detection