<?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=Advanced_Clone_Usage</id>
	<title>Advanced Clone Usage - История изменений</title>
	<link rel="self" type="application/atom+xml" href="http://digida.mgpu.ru/index.php?action=history&amp;feed=atom&amp;title=Advanced_Clone_Usage"/>
	<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Advanced_Clone_Usage&amp;action=history"/>
	<updated>2026-05-05T22:29:57Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>http://digida.mgpu.ru/index.php?title=Advanced_Clone_Usage&amp;diff=2462&amp;oldid=prev</id>
		<title>Patarakin в 08:12, 29 августа 2022</title>
		<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Advanced_Clone_Usage&amp;diff=2462&amp;oldid=prev"/>
		<updated>2022-08-29T08:12:45Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая версия&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия от 11:12, 29 августа 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l152&quot;&gt;Строка 152:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 152:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Scripting Tutorials]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Scripting Tutorials]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Cloning]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[ja:クローンの応用]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&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=Advanced_Clone_Usage&amp;diff=1656&amp;oldid=prev</id>
		<title>Patarakin: 1 версия импортирована</title>
		<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Advanced_Clone_Usage&amp;diff=1656&amp;oldid=prev"/>
		<updated>2022-07-21T08:33:13Z</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=Advanced_Clone_Usage&amp;diff=1655&amp;oldid=prev</id>
		<title>scratch&gt;TemplatesFTW: Automated edit: fixed 1 style guideline</title>
		<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Advanced_Clone_Usage&amp;diff=1655&amp;oldid=prev"/>
		<updated>2021-12-30T00:33:52Z</updated>

		<summary type="html">&lt;p&gt;Automated edit: fixed 1 style guideline&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The &amp;#039;&amp;#039;&amp;#039;usage of [[clone]]s&amp;#039;&amp;#039;&amp;#039; has the effect of multiple [[sprite]]s when only one sprite is used. There are two types of clones: those that need to share values and therefore affect other aspects of a [[project]], and those that do not.&lt;br /&gt;
&lt;br /&gt;
== Choosing the Type ==&lt;br /&gt;
If a clone needs to have its data (any info about it, such as health points (HP), [[X Position (value)|X position]], [[Y Position (value)|Y position]], etc.) accessible to the other clones or sprites, an affecting clone should be used. If a clone&amp;#039;s data does not need to be accessed by anything but itself, a non-affecting clone should be used.&lt;br /&gt;
&lt;br /&gt;
== Making Non-Affecting Clones ==&lt;br /&gt;
This type of clone does not require shared information, and therefore is simpler.&lt;br /&gt;
&lt;br /&gt;
=== Making the clones based on order of creation ===&lt;br /&gt;
One way to make non-affecting clones is to give each clone an identification number based on which order they were created in.&lt;br /&gt;
&lt;br /&gt;
==== Preparation ====&lt;br /&gt;
First you will need the following [[variable]]s:&lt;br /&gt;
* A local variable to tell the clones what ID they have, called &amp;quot;buttonNumber&amp;quot; in this tutorial&lt;br /&gt;
* Local variables for whatever properties the clones to have, such as velocity or HP&lt;br /&gt;
&lt;br /&gt;
==== Scripting ====&lt;br /&gt;
Now, make the following scripts, inside the sprite you are making these clones from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
when gf clicked&lt;br /&gt;
set [buttonNumber v] to [0]&lt;br /&gt;
repeat (3) // replace with the number of clones you need&lt;br /&gt;
change [buttonNumber v] by (1)&lt;br /&gt;
create clone of [myself v]&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, you can start scripting for each button or thing individually:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
when I start as a clone&lt;br /&gt;
if &amp;lt; (buttonNumber) = [1] &amp;gt; then&lt;br /&gt;
. . .&lt;br /&gt;
end&lt;br /&gt;
if &amp;lt; (buttonNumber) = [2] &amp;gt; then&lt;br /&gt;
. . .&lt;br /&gt;
end&lt;br /&gt;
if &amp;lt; (buttonNumber) = [3] &amp;gt; then&lt;br /&gt;
. . .&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there is something that they should all do instantaneously, put a command block before the if statements. Even better, add another When I Start as a Clone hat block and put the command(s) there.&lt;br /&gt;
&lt;br /&gt;
=== Making the clones based on many attributes ===&lt;br /&gt;
&lt;br /&gt;
Sometimes, however, in cases such as making a turret, there will be too many combinations of [[direction (value)|direction]]s, [[costume]]s, and other attributes to count. In this case you should break up the types into many attributes.&lt;br /&gt;
&lt;br /&gt;
==== Preparation ====&lt;br /&gt;
&lt;br /&gt;
For this, you will do the same thing, but make many global variables for different outcomes. In this example, the following will be used:&lt;br /&gt;
* &amp;quot;bulletType&amp;quot; for distinction between the player&amp;#039;s bullets and the opponent&amp;#039;s&lt;br /&gt;
* &amp;quot;shotX&amp;quot; and &amp;quot;shotY&amp;quot; for the starting position of the bullet&lt;br /&gt;
* &amp;quot;shotDirection&amp;quot; for the direction the bullet will move in&lt;br /&gt;
&lt;br /&gt;
==== Scripting ====&lt;br /&gt;
&lt;br /&gt;
Whenever you want a character to shoot, put this script after the trigger (like after the space bar is pressed, or some kind of condition):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
when [space v] key pressed // replace with whatever the trigger is&lt;br /&gt;
set [bulletType v] to [goodguy]&lt;br /&gt;
set [shotX v] to (x position)&lt;br /&gt;
set [shotY v] to (y position)&lt;br /&gt;
set [shotDirection v] to (direction)&lt;br /&gt;
create clone of [bullet v] // The name of the sprite you are making the clones from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, make these scripts in the bullet sprite:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
when I start as a clone&lt;br /&gt;
go to x: (shotX) y: (shotY)&lt;br /&gt;
point in direction (shotDirection)&lt;br /&gt;
if &amp;lt; (bulletType) = [goodguy] &amp;gt; then&lt;br /&gt;
  switch costume to [goodShot v]&lt;br /&gt;
  repeat until &amp;lt;&amp;lt;touching [edge v]&amp;gt; or &amp;lt;touching [enemy v]&amp;gt;&amp;gt;&lt;br /&gt;
    move (10) steps&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
if &amp;lt; (bulletType) = [badguy] &amp;gt; then&lt;br /&gt;
  switch costume to [badShot v]&lt;br /&gt;
  repeat until &amp;lt;&amp;lt;touching [edge v]&amp;gt; or &amp;lt;touching [player v]&amp;gt;&amp;gt;&lt;br /&gt;
    move (10) steps&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;quot;Effects&amp;quot; With Non-Affecting Clones ==&lt;br /&gt;
&lt;br /&gt;
Effects can be a number of things:&lt;br /&gt;
* Clouds, fog, birds, and other ambience objects.&lt;br /&gt;
* Things that add realism, and in fact are particles, such as smoke from a gun, fire from an engine, and the like.&lt;br /&gt;
&lt;br /&gt;
To make these, just use the previously prescribed method, and have as many types of effects as you need, such as [[projects:10954738|this]] project. Effects such as these actually would use the same variables as bullets, as they must be told where to go.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Making Affecting Clones ==&lt;br /&gt;
&lt;br /&gt;
These clones are as mentioned before, the type that other sprites or clones need their data, such as their position. They generally follow the same method, but store info in lists so other sprites can access it by ID.&lt;br /&gt;
&lt;br /&gt;
=== Preparation ===&lt;br /&gt;
&lt;br /&gt;
To make these type of clones, you will need the following:&lt;br /&gt;
* A global variable called &amp;quot;cloneNum&amp;quot; or something. This serves as a counter variable.&lt;br /&gt;
* A local variable called &amp;quot;myID&amp;quot;, so the clones can identify themselves.&lt;br /&gt;
* Global lists for shared properties. In this example the lists &amp;quot;Xposition&amp;quot; and &amp;quot;Yposition&amp;quot; will be used to track the coordinate locations of the clones.&lt;br /&gt;
&lt;br /&gt;
=== Scripting ===&lt;br /&gt;
&lt;br /&gt;
Put these scripts into the sprite you want to have cloned:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
when gf clicked&lt;br /&gt;
set [myID v] to [0]&lt;br /&gt;
delete (all v) of [Xposition v]&lt;br /&gt;
delete (all v) of [Yposition v]&lt;br /&gt;
repeat (10) // This is how many clones you want.&lt;br /&gt;
add [] to [Xposition v]&lt;br /&gt;
add [] to [Yposition v]&lt;br /&gt;
change [myID v] by (1)&lt;br /&gt;
create clone of [myself v]&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the clones, put this:&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
when I start as a clone&lt;br /&gt;
forever&lt;br /&gt;
replace item (myID) of [Xposition v] with (x position)&lt;br /&gt;
replace item (myID) of [Yposition v] with (y position)&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may also combine the two methods and make different classes of clones while also sharing data.&lt;br /&gt;
&lt;br /&gt;
== Example Uses ==&lt;br /&gt;
Some things this could be used to make are:&lt;br /&gt;
* Buttons from one sprite&lt;br /&gt;
* A lot of enemies for a game from one sprite, including different types of enemies&lt;br /&gt;
* Complex or semi-complex particle systems.&lt;br /&gt;
* A sprite called &amp;quot;effects&amp;quot; and have all effects, such as dust clouds, explosions, and other effects all come from this sprite.&lt;br /&gt;
* A Tower Defense game, having as much as 200 or so towers on a map.&lt;br /&gt;
* A sprite for bullets, have as much of those as you want, for as many different characters as you need.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Detecting Clones]]&lt;br /&gt;
* [[Using Clones for Particle Effects]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Tutorials]]&lt;br /&gt;
[[Category:Cloning]]&lt;br /&gt;
[[ja:クローンの応用]]&lt;/div&gt;</summary>
		<author><name>scratch&gt;TemplatesFTW</name></author>
	</entry>
</feed>