Discuss Scratch

aartigandhale22
New Scratcher
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.
asivi
Scratcher
1000+ posts

Selection of specific costume of sprite

ifthenhere you may put a condition from sensing blocksTheblocksbelowreport"True"or"False"touching?touchingcolor?coloristouching?mousedown?theothersroundedblocksinsidethesensingsectionmaybeusedinconjunctionwithoperatorblocksdistancetoanswermousexmouseyloudnessvideoon timerof currentdayssince2000username
So, you can do this:
whenclickedforeverifkeyup arrowpressed?thenswitchcostumetoup costume
or this other:
whenclickedforeverifdistancetogirlfriend<50thenswitchcostumetosmiling costume
aartigandhale22
New Scratcher
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
Scratcher
1000+ posts

Selection of specific costume of sprite

aartigandhale22 wrote:

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…

ifcostume#=1 thendowhatyouwantdoneforthatcostumeifcostume#=2 thendowhatyouwantdoneforthatcostumeifcostume#=3 thendowhatyouwantdoneforthatcostume

If there are lots of costumes to check then you might want to take an approach that uses a list variable.
deck26
Scratcher
1000+ posts

Selection of specific costume of sprite

I suspect what you're looking for is

costume #ofspritename
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
New Scratcher
5 posts

Selection of specific costume of sprite

Thank you footsocktoe and deck26. You both are correct. Both the solutions are helpful for me.

Powered by DjangoBB