This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-04-26 13:49:04

aceski
New Scratcher
Registered: 2012-04-26
Posts: 2

Can I phase a costume?

I would like the cosume to phase from one image to the next. I have it set up to switch to next costume, but it happens in an instant rather than a slow transition. Any thoughts?

Offline

 

#2 2012-04-26 13:50:38

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Can I phase a costume?

I made up a rather crude way to do it, which uses two sprites, one for each costume. Here's my project.  smile

Offline

 

#3 2012-04-26 16:35:07

aceski
New Scratcher
Registered: 2012-04-26
Posts: 2

Re: Can I phase a costume?

Thanks scimonster, that looks like its what I needed. However I am still new and I cannot figure out how you used that code.

Offline

 

#4 2012-04-28 09:40:31

BetaSmozzick
Scratcher
Registered: 2012-02-25
Posts: 51

Re: Can I phase a costume?

I'm not sure how scimonster's works but using two sprites I've gotten a similar effect working. What you do is that you put a sprite with the second costume you are changing to under the first sprite.

The second sprite has this:

when gf clicked
set [ghost effect v] to [100]
Which effectively hides it from view. You can also put a hide block after the set ghost part to stop color sensing from being affected by it.

The first sprite should have the opposite in it.

when gf clicked
set [ghost effect v] to [0]
Now on your screen one sprite is visible and one isn't.

For the transition you want this in the first sprite after the above blocks:

repeat [10]
change [ghost v] effect by [-10]
wait [0.05] secs
end
For the second sprite you want this:

repeat [10]
change [ghost v] effect by [10]
wait [0.05] secs
end
And that's it. You can change the repeat and amount ghost effects changes by but when multiplied together they should equal 100 (e.g. 10 * 10 = 100).

Obviously you don't need to use the green flag clicked bit and that could instead be a key press or something.

I'll upload a version in a moment so that you can see how this way would look like.

Offline

 

Board footer