Revision as of 20:05, 9 December 2018 by InterwikiBot (talk | contribs) (Adding interwikis.)

Next Costume
2.0 Next Costume.png
Category Looks
Type Stack

The Next Costume block is a Looks block and a Stack block. The block changes its sprite's costume to the next one in the costumes pane, but if the current costume is the last in the list, the block will loop to the first.

The Stage's version is Next Backdrop.

Example Uses

This block is mainly used in animation scripts, in which a sprite will progress through its costumes as with stop motion animation. The Wait () Secs block is often used along with it to improve the animation speed.

An example script is below:

when gf clicked
repeat (10)
   next costume
   wait (0.05) secs
end

This contains the costume change and the animation delay.

Workaround

Main article: List of Block Workarounds

Along with the Switch Costume to () block, it is one of the most commonly used Looks blocks. However, this block is technically unnecessary due to the fact that the following code can be used:

switch costume to ((costume #) + (1))

To get the effect of the nonexistent previous costume :: looks block, the addition can be changed to subtraction, like this:

switch costume to ((costume #) - (1))

Removal

Many users have made suggestions about removing this block, insisting that it does not make any sense without a Previous Costume block.[1] However, others have disagreed, saying that it saves time, is useful for animations, makes the scripting area less cluttered, and helps new Scratchers be less confused.[2][3]

The Scratch Team made a comment on it[4] and announces that they might remove the block if it makes sense.

References

  1. http://scratch.mit.edu/discuss/topic/96594/
  2. ar-topic:26735
  3. ar-post:1513879
  4. http://scratch.mit.edu/discuss/topic/96594/?page=2#post-842942

See Also