Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Selection of specific costume of sprite
- aartigandhale22
-
5 posts
Selection of specific costume of sprite
Hello!
Is there any way to select specific costume of the sprite in Scratch to put it in conditions like { if touching… }. In dropdown list we can select sprites but I want to put condition for specific costume of sprite. Please help me.
Is there any way to select specific costume of the sprite in Scratch to put it in conditions like { if touching… }. In dropdown list we can select sprites but I want to put condition for specific costume of sprite. Please help me.
- asivi
-
1000+ posts
Selection of specific costume of sprite
So, you can do this:
or this other:
- aartigandhale22
-
5 posts
Selection of specific costume of sprite
hey thanks for your reply. What I want is how can we select specific costume of sprite. for e.g. Suppose I have bubble as a sprite and red bubble, blue bubble, yellow bubble are its costumes. From drop down list with any condition I can select only bubble but what if I want to select Red or Yellow or Blue bubble? How can I do this without representing them as different sprites in my game or animation?
- footsocktoe
-
1000+ posts
Selection of specific costume of sprite
hey thanks for your reply. What I want is how can we select specific costume of sprite. for e.g. Suppose I have bubble as a sprite and red bubble, blue bubble, yellow bubble are its costumes. From drop down list with any condition I can select only bubble but what if I want to select Red or Yellow or Blue bubble? How can I do this without representing them as different sprites in my game or animation?
Do I understand you correctly? You want to do an IF- THEN where the condition is which costume the sprite is wearing?
If there are only 2 or 3 costumes then just do separate blocks…
If there are lots of costumes to check then you might want to take an approach that uses a list variable.
- deck26
-
1000+ posts
Selection of specific costume of sprite
I suspect what you're looking for is
Is that what you're asking?
which (when used in an if block) will allow spriteB to behave differently according to the costume of spriteA. So check if you're touching and then, if you are, what the costume of the other sprite is or combine them in a single if.
Is that what you're asking?
- aartigandhale22
-
5 posts
Selection of specific costume of sprite
Thank you footsocktoe and deck26. You both are correct. Both the solutions are helpful for me.
- Discussion Forums
- » Help with Scripts
-
» Selection of specific costume of sprite