AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Contents · Computing

Making a simple animation program

Lessons 29 · 1 lessons · D.T. Kamaltdinova, D.M. Sayfurov. Informatics and Information Technology, Grade 5 (general editor F.M. Zakirova). “Nashriyot uyi Tasvir”, Tashkent, 2020
29

Making a simple animation program

Textbook: pp. 94–97
GoalExplain what animation is; build a simple script from motion, turn and repeat blocks and move a sprite across the stage.
New words
animation: making pictures appear to move · animatsiyarepeat block: runs the blocks inside it several times · takrorlash blokidirection in degrees: 0 up, 90 right, 180 down, –90 left · yo‘nalish (gradus)if on edge, bounce · chetga yetsa, qayt
Explanation

Animation comes from French for “bringing to life”: pictures or objects appear to move. On a computer this is done by changing a sprite’s position in many small steps or by switching its costumes quickly. A script usually starts with the “when green flag clicked” block from Events, with Motion blocks snapped below: “move 10 steps”, “turn 15 degrees”, “point in direction 90”, “go to x, y”. Direction is given in degrees: 0 is up, 90 is right, 180 is down, –90 (that is, 270) is left. The “if on edge, bounce” block sends the sprite back from the stage edge. The Repeat block runs the commands inside it a set number of times, and Forever repeats until stopped. For example, “repeat 5: move 20 steps” makes the sprite go 5 × 20 = 100 steps in all. Run the script, watch the result and change the numbers if needed.

0°90°180°–90°
💡 Where will I use this?
In real life

In training a coach says “do ten sit-and-stands” rather than saying it ten separate times. Repetition gives a short, exact instruction. The “repeat” block in a program does just that.

Who uses it

A programmer writes repeated jobs briefly, a coach gives exercises as repeats, and an animator builds movement with a loop.

Try it today

Write a short instruction using repetition (such as “clap, 5 times”) and let a friend carry it out.

Worked examples
Startforever (until stopped)yesmove 10 stepsif on edge, bouncenoEnd
Script: when green flag clicked → forever: move 10 steps; if on edge, bounce. The cat goes back and forth across the stage; it crosses the 480-unit width in about 48 repeats of 10 steps.
A spinning sprite: “repeat 24: turn 15 degrees”. 24 × 15 = 360 degrees – the sprite makes one full turn.
Class activity

“Living script”: in groups, one pupil acts as the “sprite” and moves around the room following commands on the board (steps, turns, repeat). Then the script is tested in Scratch.

Practice
1
What is animation and how is it made on a computer?
2
Which directions are 0, 90, 180 and –90 degrees?
3
How many steps in all does “repeat 8: move 15 steps” make the sprite go?
4
Why is Repeat sometimes better than Forever?
Story of the Week · The Khwarizmi WayA place for the compost heapClose the week: all of this week’s subjects in one storyRead →