Lessons 30 · 1 lessons · D.T. Kamaltdinova, D.M. Sayfurov. Informatics and Information Technology, Grade 5 (general editor F.M. Zakirova). “Nashriyot uyi Tasvir”, Tashkent, 2020
30
Changing sprite costumes
Textbook: pp. 98–99
GoalKnow what a costume is, choose and edit costumes on the Costumes tab, animate a sprite by switching costumes and add a sound to it.
New words
costume: one look or pose of a sprite · kostyum (libos)switching to the next costume · kostyumni almashtirishwait block: pauses the script for a set time · kutish blokia sound added to a sprite · ovoz (Sound)
Explanation
Every sprite has at least one costume; some have several – for example the cat’s two walking poses. Costumes appear on the Costumes tab. There you can choose a new costume, paint your own, upload from the computer or pick one at random, and also recolour or change an existing costume with the paint editor. In the program the “next costume” or “switch costume to ...” blocks from Looks change the costume. To make movement look alive, add a short pause between costumes with the “wait” block (for example 0.2 seconds) and put it all inside “forever” or “repeat”. To add a sound to a sprite, choose a sound on the Sounds tab and add the “start sound” block in the code. If you use headphones, keep the volume low. Two separate scripts can run at the same time: one switching costumes, the other playing music.
Worked examples
A walking sprite: green flag → forever: move 10 steps, next costume, wait 0.2 seconds. Because costumes switch quickly the sprite looks as if it is walking.
A dance: script 1 forever switches costumes; script 2 forever plays music. If the sprite has 8 costumes and waits 0.25 s each, one full cycle takes 8 × 0.25 = 2 seconds.
Class activity
“Flip-book”: pupils draw successive poses of a stick figure on 5–6 pages and flip the pages fast to see movement – just like switching costumes.
Practice
1
What is a costume?
One look or pose of a sprite.
2
Which block switches to the next costume and in which category is it?
“Next costume”; in the Looks category.
3
A sprite has 5 costumes, each shown for 2 seconds. How many seconds does one full cycle last?
10
4
Why is a wait block needed between costumes?
Without waiting, costumes switch too fast and the movement cannot be seen.