<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>http://digida.mgpu.ru/index.php?action=history&amp;feed=atom&amp;title=Animating_a_Sprite</id>
	<title>Animating a Sprite - История изменений</title>
	<link rel="self" type="application/atom+xml" href="http://digida.mgpu.ru/index.php?action=history&amp;feed=atom&amp;title=Animating_a_Sprite"/>
	<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Animating_a_Sprite&amp;action=history"/>
	<updated>2026-06-20T12:49:51Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>http://digida.mgpu.ru/index.php?title=Animating_a_Sprite&amp;diff=1722&amp;oldid=prev</id>
		<title>Patarakin: 1 версия импортирована</title>
		<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Animating_a_Sprite&amp;diff=1722&amp;oldid=prev"/>
		<updated>2022-07-21T08:33:15Z</updated>

		<summary type="html">&lt;p&gt;1 версия импортирована&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая версия&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия от 11:33, 21 июля 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Patarakin</name></author>
	</entry>
	<entry>
		<id>http://digida.mgpu.ru/index.php?title=Animating_a_Sprite&amp;diff=1721&amp;oldid=prev</id>
		<title>scratch&gt;Wangat: Reworded</title>
		<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Animating_a_Sprite&amp;diff=1721&amp;oldid=prev"/>
		<updated>2022-02-27T01:07:59Z</updated>

		<summary type="html">&lt;p&gt;Reworded&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Animating a sprite&amp;#039;&amp;#039;&amp;#039; is the process of a [[sprite]] repeatedly changes costumes, creating an animation. Animation [[script]]s vary, depending on the number of costumes and speed.&lt;br /&gt;
&lt;br /&gt;
== Creating an Animating Script ==&lt;br /&gt;
&lt;br /&gt;
The simplest way to animate a sprite is to repeatedly use the [[Switch Costume to () (block)|switch costume to ()]] and [[Wait () Seconds (block)|wait () seconds]] blocks:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
switch costume to [Slash1 v]&lt;br /&gt;
wait (0.05) seconds&lt;br /&gt;
switch costume to [Slash2 v]&lt;br /&gt;
wait (0.05) seconds&lt;br /&gt;
switch costume to [Slash3 v]&lt;br /&gt;
wait (0.05) seconds&lt;br /&gt;
switch costume to [Slash4 v]&lt;br /&gt;
wait (0.05) seconds&lt;br /&gt;
switch costume to [Slash5 v]&lt;br /&gt;
wait (0.05) seconds&lt;br /&gt;
switch costume to [Slash6 v]&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This, however, is lengthy and redundant. An alternative method involves iteration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
switch costume to [Slash1 v]&lt;br /&gt;
repeat (5)&lt;br /&gt;
    wait (0.05) seconds&lt;br /&gt;
    next costume&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script produces the same effect, but conserves space, which is quite useful if there are many costumes being displayed.&lt;br /&gt;
&lt;br /&gt;
Another way to animate is by using operator blocks. This method allows for more control over the animation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
repeat until &amp;lt;(costume [number v] :: looks) = (5) &amp;gt;&lt;br /&gt;
    next costume&lt;br /&gt;
    wait (0.05) seconds&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script says to animate the sprite until a certain costume. This allows the sprite to move, stop, talk, then move again.&lt;br /&gt;
&lt;br /&gt;
== Animation Delays ==&lt;br /&gt;
Sometimes, costumes may change quickly enough that the animation produced is faster than desired. Animations can be slowed by adding the [[Wait () Seconds (block)|Wait () Seconds]] block into the animation script. The wait time is changed according to the frame rate, with more frames having small wait times.&lt;br /&gt;
&lt;br /&gt;
An inefficient animation script with delays:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
switch costume to [Stab1 v]&lt;br /&gt;
wait (0.1) seconds&lt;br /&gt;
switch costume to [Stab2 v]&lt;br /&gt;
wait (0.1) seconds&lt;br /&gt;
switch costume to [Stab3 v]&lt;br /&gt;
wait (0.1) seconds&lt;br /&gt;
switch costume to [Stab4 v]&lt;br /&gt;
wait (0.1) seconds&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An efficient animation script with delays:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
switch costume to [Stab1 v]&lt;br /&gt;
repeat (5)&lt;br /&gt;
   wait (0.1) seconds&lt;br /&gt;
   next costume&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The number in the [[Repeat () (block)|Repeat ()]] block is set to the amount of costumes that will be used, not counting the first one that is before the block.&lt;br /&gt;
&lt;br /&gt;
In some animations, the animation delay may have to change as the animation is running. With the expanded script, it is easy; the multiple delay blocks simply have to be adjusted correctly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
switch costume to [Strike1 v]&lt;br /&gt;
wait (0.1) seconds&lt;br /&gt;
switch costume to [Strike2 v]&lt;br /&gt;
wait (0.2) seconds&lt;br /&gt;
switch costume to [Strike3 v]&lt;br /&gt;
wait (0.3) seconds&lt;br /&gt;
switch costume to [Strike4 v]&lt;br /&gt;
wait (0.4) seconds&lt;br /&gt;
switch costume to [Strike5 v]&lt;br /&gt;
wait (0.5) seconds&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the compact script, the second delay block is being used multiple times, and will, therefore, have to change accordingly.&lt;br /&gt;
&lt;br /&gt;
If the animation delay is repeatedly being changed by the same amount, a [[variable]] can be inserted into the delay block and repeatedly changed in the [[Repeat () (block)|Repeat ()]] block:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
set [delay v] to (0.1)&lt;br /&gt;
switch costume to [Strike1 v]&lt;br /&gt;
repeat (4)&lt;br /&gt;
    wait (delay) seconds&lt;br /&gt;
    next costume&lt;br /&gt;
    change [delay v] by (0.1)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the animation delay is changing in an unpredictable way, a list can be used, its items giving the animation delay:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
set [item v] to (1)&lt;br /&gt;
switch costume to [Strike1 v]&lt;br /&gt;
repeat (4)&lt;br /&gt;
    wait (item (item) of [delays v]) secs&lt;br /&gt;
    next costume&lt;br /&gt;
    change [item v] by (1)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Animation Projects]]&lt;br /&gt;
* [[Animating a 3D Object]]&lt;br /&gt;
* [[Barrier Grid Animation]]&lt;br /&gt;
* [[Walk Cycles]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Drawing and Animation Tutorials]]&lt;br /&gt;
[[Category:Scripting Tutorials]]&lt;br /&gt;
[[de:Figuren animieren]]&lt;br /&gt;
[[fr:Scratch Wiki Accueil/tutos/016 animation lutin]]&lt;/div&gt;</summary>
		<author><name>scratch&gt;Wangat</name></author>
	</entry>
</feed>