<?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=Object_Repulsion</id>
	<title>Object Repulsion - История изменений</title>
	<link rel="self" type="application/atom+xml" href="http://digida.mgpu.ru/index.php?action=history&amp;feed=atom&amp;title=Object_Repulsion"/>
	<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Object_Repulsion&amp;action=history"/>
	<updated>2026-05-28T01:16:52Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>http://digida.mgpu.ru/index.php?title=Object_Repulsion&amp;diff=1728&amp;oldid=prev</id>
		<title>Patarakin: 1 версия импортирована</title>
		<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Object_Repulsion&amp;diff=1728&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=Object_Repulsion&amp;diff=1727&amp;oldid=prev</id>
		<title>scratch&gt;PenguinLover1123: /* Direct Movement Method */ block -1</title>
		<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Object_Repulsion&amp;diff=1727&amp;oldid=prev"/>
		<updated>2021-09-15T20:09:42Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Direct Movement Method: &lt;/span&gt; block -1&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Object Repulsion&amp;#039;&amp;#039;&amp;#039; is the act of repulsing or repelling an object. Listed below are two methods of replicating this effect in [[Scratch]].&lt;br /&gt;
{{tip|Please remember to adjust the scripts shown in this tutorial as necessary to best fit a [[project]].}}&lt;br /&gt;
&lt;br /&gt;
==Velocity Method==&lt;br /&gt;
The Velocity Method uses the following scripts to automatically make objects change their X and Y Velocity based upon their position. This script can go into any object that is being repelled. This method is more advanced than the next method, however this method is better in &amp;#039;&amp;#039;most&amp;#039;&amp;#039; situations.&lt;br /&gt;
&lt;br /&gt;
{{note|Adding this will make the sprite move.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
when green flag clicked&lt;br /&gt;
go to x: (0) y: (0)&lt;br /&gt;
set [y speed v] to (0)&lt;br /&gt;
set [x speed v] to (0)&lt;br /&gt;
forever&lt;br /&gt;
  if &amp;lt;([abs v] of (([x position v] of (Sprite1 v)) - ([x position v] of (Sprite2 v)))) &amp;lt; [50]&amp;gt; then&lt;br /&gt;
    if &amp;lt;([x position v] of (Sprite 2 v)) &amp;gt; (x position)&amp;gt; then&lt;br /&gt;
      change [x speed v] by (-0.1)&lt;br /&gt;
    end&lt;br /&gt;
    if &amp;lt;([x position v] of (Sprite 2 v)) &amp;lt; (x position)&amp;gt; then&lt;br /&gt;
      change [x speed v] by (0.1)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  if &amp;lt;([abs v] of (([y position v] of (Sprite1 v)) - ([y position v] of (Sprite2 v)))) &amp;lt; [50]&amp;gt; then&lt;br /&gt;
    if &amp;lt;([y position v] of (Sprite 2 v)) &amp;gt; (y position)&amp;gt; then&lt;br /&gt;
      change [y speed v] by (-0.1)&lt;br /&gt;
    end&lt;br /&gt;
    if &amp;lt;([y position v] of (Sprite 2 v)) &amp;lt; (y position)&amp;gt; then&lt;br /&gt;
      change [y speed v] by (0.1)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
when green flag clicked&lt;br /&gt;
forever&lt;br /&gt;
  if on edge, bounce&lt;br /&gt;
  change x by (x speed)&lt;br /&gt;
  change y by (y speed)&lt;br /&gt;
  set [x speed v] to ((0.98) * (x speed))&lt;br /&gt;
  set [y speed v] to ((0.98) * (y speed))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example can be seen [[projects:1346516|here]].&lt;br /&gt;
&lt;br /&gt;
==Direct Movement Method==&lt;br /&gt;
The Direct Movement Method uses the [[script]]s below to move and rotate based on its position. This method is basic, but very effective in doing its job.&lt;br /&gt;
&lt;br /&gt;
{{note|This script can only be used in one [[sprite]] at a time unlike the velocity method.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- [[File:DMRepulsion.png]] --&amp;gt;&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
when gf clicked&lt;br /&gt;
go to x: (0) y: (-1)&lt;br /&gt;
forever&lt;br /&gt;
   if &amp;lt;(distance to [Sprite2 v]) &amp;lt; [50]&amp;gt; then&lt;br /&gt;
      point towards [Sprite2 v]&lt;br /&gt;
      move (-10) steps&lt;br /&gt;
      if on edge, bounce&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example can be seen [[projects:1346517|here]].&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[Object Attraction]]&lt;br /&gt;
* [[Simulating Gravity]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Physics Tutorials]]&lt;br /&gt;
[[Category:Scripting Tutorials]]&lt;br /&gt;
[[ja:オブジェクト間の斥力]]&lt;/div&gt;</summary>
		<author><name>scratch&gt;PenguinLover1123</name></author>
	</entry>
</feed>