Category:Sprites

Creates a new named sprite of the chosen costume at the given location.

Video: How to Make a Sprite

(Opens YouTube in new tab)

How To Make A Sprite

This block assigns the created sprite to a name, like a variable. This is useful for creating a special sprite that you will want to refer to by name throughout your program. This block also customizes how the sprite looks and where it starts on the display. The drop down menu gives a variety of sprite costumes to choose from and also has the option to draw a costume. A location block can be attached at the end of the block to control where the sprite will appear on the display.

Examples

Each sprite has the same costume, but a different behavior.

Parameters

NameDescription
name The name you would like to use to refer to this sprite
location The location where the sprite appears on the display
costume Each Sprite Lab project or level will include some default sprite costumes, but you can also choose from a larger costume library or draw your own using the built-in pixel editor.

Tips

  • Use a different name for each named sprite. If two or more sprites are created with the same name, only the most recently created one will be affected by code that uses that sprite name.

Found a bug in the documentation? Let us know at documentation@code.org