Discuss Scratch

TheDarkLatios
Scratcher
21 posts

How can I make my sprite only do something in a certain Costume?

So, in this project (https://scratch.mit.edu/projects/215901535/), I'm currently trying to get Kirby to have unlimited flight, but only in his Wing costume, and he can only jump once in all other costumes. How can I do this? I hope you can help.

Last edited by TheDarkLatios (April 13, 2018 02:49:24)

lwell72
Scratcher
100+ posts

How can I make my sprite only do something in a certain Costume?

You put an if block in your code. For example
whenclickedforeverifcostume#=you can put any number herethenDosomthing
TheDarkLatios
Scratcher
21 posts

How can I make my sprite only do something in a certain Costume?

lwell72 wrote:

You put an if block in your code. For example
whenclickedforeverifcostume#=you can put any number herethenDosomthing

I tried that

Last edited by TheDarkLatios (April 13, 2018 03:22:27)

deck26
Scratcher
1000+ posts

How can I make my sprite only do something in a certain Costume?

TheDarkLatios wrote:

lwell72 wrote:

You put an if block in your code. For example
whenclickedforeverifcostume#=you can put any number herethenDosomthing

I tried that
Share please as using an if block IS the answer so there's something else going on.
TheDarkLatios
Scratcher
21 posts

How can I make my sprite only do something in a certain Costume?

deck26 wrote:

TheDarkLatios wrote:

lwell72 wrote:

You put an if block in your code. For example
whenclickedforeverifcostume#=you can put any number herethenDosomthing

I tried that
Share please as using an if block IS the answer so there's something else going on.
Do you mean the project? If so, the link is here https://scratch.mit.edu/projects/215901535/
deck26
Scratcher
1000+ posts

How can I make my sprite only do something in a certain Costume?

Before you get much further I strongly recommend looking at @griffpatch_tutor's platformer tutorial. That script you're using with the multiple ‘if touching colour change y by 1’ is something that we see regularly here causing problems and personally I really dislike it!

The script works as far as I can see. If sprite1 has costume 1 you get prompted for ability when you press the down arrow and if you set it to a different costume it gets reset to costume 1.

Powered by DjangoBB