<?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=Wall-Jumping</id>
	<title>Wall-Jumping - История изменений</title>
	<link rel="self" type="application/atom+xml" href="http://digida.mgpu.ru/index.php?action=history&amp;feed=atom&amp;title=Wall-Jumping"/>
	<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Wall-Jumping&amp;action=history"/>
	<updated>2026-06-14T08:05:00Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>http://digida.mgpu.ru/index.php?title=Wall-Jumping&amp;diff=1672&amp;oldid=prev</id>
		<title>Patarakin: 1 версия импортирована</title>
		<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Wall-Jumping&amp;diff=1672&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=Wall-Jumping&amp;diff=1671&amp;oldid=prev</id>
		<title>scratch&gt;TheTrillion: Changed a link.</title>
		<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Wall-Jumping&amp;diff=1671&amp;oldid=prev"/>
		<updated>2021-05-08T04:34:24Z</updated>

		<summary type="html">&lt;p&gt;Changed a link.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Wall-Jumping&amp;#039;&amp;#039;&amp;#039; is a technique used in [[Scratch]] to make [[sprite]]s bounce off walls. This allows a character in a project, for instance, to scale up massive heights of walls rather than jumping on individualized sections like stairs. It is commonly used in [[platformer]]s.&lt;br /&gt;
&lt;br /&gt;
== Method ==&lt;br /&gt;
This is just one of the ways for wall jumping to work.&lt;br /&gt;
&lt;br /&gt;
Three variables are needed for this method to operate properly:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;L-vel&amp;#039;&amp;#039;&amp;#039; {{-}} The [[velocity]] of the player going left&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;R-vel&amp;#039;&amp;#039;&amp;#039; {{-}} The velocity of the player going right&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Y-vel&amp;#039;&amp;#039;&amp;#039; {{-}} The velocity of the player on the [[Y Position (value)|y axis]]&lt;br /&gt;
&lt;br /&gt;
Afterwards, a player sprite should be made. This is the sprite that will perform all motions and be physically wall-jumping. An example of a player sprite is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Wall Jumping Sprite.png]]&lt;br /&gt;
&lt;br /&gt;
The colours on each side of the square are the sensors that will use to &amp;quot;sense&amp;quot; which side the wall and floor are relative to the character. Using more complicated coding, it wouldn&amp;#039;t require colours.&lt;br /&gt;
&lt;br /&gt;
Two separate scripts are needed then, one for moving and one for sensing walls:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
when gf clicked&lt;br /&gt;
set [R-vel v] to [0]&lt;br /&gt;
set [L-vel v] to [0]&lt;br /&gt;
forever&lt;br /&gt;
if &amp;lt;key (right arrow v) pressed?&amp;gt; then&lt;br /&gt;
change [R-vel v] by (1)&lt;br /&gt;
end&lt;br /&gt;
if &amp;lt;key (left arrow v) pressed?&amp;gt; then&lt;br /&gt;
change [L-vel v] by (1)&lt;br /&gt;
end&lt;br /&gt;
if &amp;lt;key (up arrow v) pressed?&amp;gt; then&lt;br /&gt;
if &amp;lt;color [#0000FF] is touching [#000000]?&amp;gt; then&lt;br /&gt;
set [Y-vel v] to [20]&lt;br /&gt;
broadcast (Jump v)&lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
if &amp;lt;not &amp;lt;color [#0000FF] is touching [#000000]?&amp;gt;&amp;gt; then&lt;br /&gt;
change y by (-5)&lt;br /&gt;
end&lt;br /&gt;
if &amp;lt;color [#FF0000] is touching [#000000]?&amp;gt; then&lt;br /&gt;
set [Y-vel v] to [0]&lt;br /&gt;
set [R-vel v] to [0]&lt;br /&gt;
if &amp;lt;not &amp;lt; &amp;lt;color [#0000FF] is touching [#000000]?&amp;gt; or &amp;lt;key (up arrow v) pressed?&amp;gt; &amp;gt; &amp;gt; then&lt;br /&gt;
wait (0.5) secs&lt;br /&gt;
if &amp;lt;key (up arrow v) pressed?&amp;gt; then&lt;br /&gt;
set [Y-vel v] to [20]&lt;br /&gt;
broadcast (Jump v)&lt;br /&gt;
end&lt;br /&gt;
set [L-vel v] to [10]&lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
if &amp;lt;color [#00FF00] is touching [#000000]?&amp;gt; then&lt;br /&gt;
set [Y-vel v] to [0]&lt;br /&gt;
set [L-vel v] to [0]&lt;br /&gt;
if &amp;lt;not &amp;lt; &amp;lt;color [#0000FF] is touching [#000000]?&amp;gt; or &amp;lt;key (up arrow v) pressed?&amp;gt; &amp;gt; &amp;gt; then&lt;br /&gt;
wait (0.5) secs&lt;br /&gt;
if &amp;lt;key (up arrow v) pressed?&amp;gt; then&lt;br /&gt;
set [Y-vel v] to [20]&lt;br /&gt;
broadcast (Jump v)&lt;br /&gt;
end&lt;br /&gt;
set [R-vel v] to [10]&lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
change x by (R-vel)&lt;br /&gt;
change x by ((0) - (L-vel))&lt;br /&gt;
change [R-vel v] by ((R-vel) * (-0.2))&lt;br /&gt;
change [L-vel v] by ((L-vel) * (-0.2))&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|The color black can be changed depending on the color of the wall and floor sprites, but the floor and walls must be the same color.}}&lt;br /&gt;
&lt;br /&gt;
And one for jumping:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;when I receive [Jump v]&lt;br /&gt;
repeat (10)&lt;br /&gt;
if &amp;lt;color [#FFFF00] is touching [#000000]?&amp;gt; then&lt;br /&gt;
set [Y-vel v] to [0]&lt;br /&gt;
stop [this script v]&lt;br /&gt;
end&lt;br /&gt;
change y by (Y-vel)&lt;br /&gt;
change [Y-vel v] by (-1)&lt;br /&gt;
end&lt;br /&gt;
set [Y-vel v] to [0]&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is another way of doing it.&lt;br /&gt;
One variable is needed&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;velocity&amp;#039;&amp;#039;&amp;#039; {{-}} The velocity of the player&amp;#039;s horizontal movement.&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
when gf clicked&lt;br /&gt;
forever&lt;br /&gt;
if &amp;lt;key (left arrow v) pressed?&amp;gt; then&lt;br /&gt;
change [velocity v] by (-1)&lt;br /&gt;
end&lt;br /&gt;
if &amp;lt;key (right arrow v) pressed?&amp;gt; then&lt;br /&gt;
change [velocity v] by (1)&lt;br /&gt;
end&lt;br /&gt;
if &amp;lt;not &amp;lt;touching (ground v)?&amp;gt;&amp;gt; then&lt;br /&gt;
change y by (-10)&lt;br /&gt;
end&lt;br /&gt;
if &amp;lt;key (up arrow v) pressed?&amp;gt; then&lt;br /&gt;
change y by (60)&lt;br /&gt;
end&lt;br /&gt;
change y by (1)&lt;br /&gt;
change x by (velocity)&lt;br /&gt;
if &amp;lt;touching (ground v)?&amp;gt; then&lt;br /&gt;
change x by ((0)-(velocity))&lt;br /&gt;
if &amp;lt;key (up arrow v) pressed?&amp;gt; then&lt;br /&gt;
change y by (60)&lt;br /&gt;
change x by ((0)-(velocity))&lt;br /&gt;
end&lt;br /&gt;
change y by (-1)&lt;br /&gt;
set [velocity v] to ((velocity)*(0.75))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Method 2 ==&lt;br /&gt;
An easier way uses very simple coding. The sprite can be any color, and no velocity script is needed. Gray should be the color of the walls.&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
when gf clicked&lt;br /&gt;
set [wall jump v] to (0)&lt;br /&gt;
forever&lt;br /&gt;
if &amp;lt;&amp;lt;&amp;lt;not&amp;lt;touching color [#000000]?&amp;gt;&amp;gt;and&amp;lt;touching color[#444444]?&amp;gt;&amp;gt;and&amp;lt;&amp;lt;key (space v) pressed?&amp;gt;or&amp;lt;key (up arrow v) pressed?&amp;gt;&amp;gt;&amp;gt; then&lt;br /&gt;
if &amp;lt;not&amp;lt;(wall jump)=(1)&amp;gt;&amp;gt; then&lt;br /&gt;
set [wall jump v] to (1)&lt;br /&gt;
repeat (10)&lt;br /&gt;
change y by (15)&lt;br /&gt;
end&lt;br /&gt;
wait until &amp;lt;color [#0000FF] is touching [#000000]?&amp;gt;&lt;br /&gt;
set [wall jump v] to (0)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
A separate code is needed to make movement.&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
when gf clicked&lt;br /&gt;
forever&lt;br /&gt;
if &amp;lt;key (left arrow v) pressed?&amp;gt; then&lt;br /&gt;
change x by (-4)&lt;br /&gt;
end&lt;br /&gt;
if &amp;lt;key (right arrow v) pressed?&amp;gt; then&lt;br /&gt;
change x by (4)&lt;br /&gt;
end&lt;br /&gt;
if &amp;lt;&amp;lt;key (space v) pressed?&amp;gt;and&amp;lt;color [#0000FF] is touching [#000000]?&amp;gt;&amp;gt; then&lt;br /&gt;
repeat (10)&lt;br /&gt;
change y by (15)&lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
if &amp;lt;not&amp;lt;color[#0000FF] is touching [#000000]?&amp;gt;&amp;gt; then&lt;br /&gt;
change y by (-7)&lt;br /&gt;
end&lt;br /&gt;
if &amp;lt;color [#FFFF00] is touching [#000000]?&amp;gt; then&lt;br /&gt;
change y by (-8)&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
* [[projects:1813671|Wall jump engine]] (the script that was used for this article)&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Platformer]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Tutorials]]&lt;br /&gt;
[[Category:Game Design Tutorials]]&lt;br /&gt;
[[Category:Physics Tutorials]]&lt;br /&gt;
[[ja:壁キックジャンプ]]&lt;/div&gt;</summary>
		<author><name>scratch&gt;TheTrillion</name></author>
	</entry>
</feed>