Table of Contents

Function Definition: nextcostume()

Parameters

Description

The function 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.

Example

The example demonstrates the costume change in PictoBlox.

Code

sprite = Sprite('Tobi')

sprite.gotoxy(0, 0)
sprite.setsize(200)
sprite.switchcostume("Tobi")

while True:
  sprite.say(sprite.costume("name"), 1)
  sprite.nextcostume()

Output

Read More
All articles loaded
No more articles to load