Changing costumes of sprite
A costume is one out of possibly many "frames" or alternate appearances of a sprite. Sprites can change their look to any of its costumes. They can be named, edited, created, and deleted, but every sprite must have at least one costume. One of the most common uses of costumes is to make an animation for a game or other projects. Each sprite can have multiple costumes. You can check the costume of your sprite from the Costumes tab.
To add a new costume for your sprite select one of three options below:
- Paint
- Import
- Camera
Simplest way among these three ways is to import costumes.
When your sprite has more than one costumes, they are displayed below the Costumes tab.
For example, when the cat sprite is chosen and costume is clicked the screen appears as below showing the two costumes.
Changing the costume of sprite
1.In Blocks Palette selects “Looks” category and the blocks appears as shown below:
- Drag “Switch to costumes” block and drop into the script area.
- Select the costume out of the options by clicking the drop down arrow:
When this block is clicked, it will change costume 1 to costume 2
Sample Sprite Script
Here is a sample sprite script which changes the costume of the sprite.
- The Sprite changes the costume to “costume2”
- Waits for 1 sec. ( Get “wait” block from Control option in Blocks Palette)
- Then sprite changes back to costume 1 (As next costume block changes the costume to the next in order. As there are only two costumes, both will be changed alternatively).
No comments:
Post a Comment