<?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_Platformer_Physics</id>
	<title>Advanced Platformer Physics - История изменений</title>
	<link rel="self" type="application/atom+xml" href="http://digida.mgpu.ru/index.php?action=history&amp;feed=atom&amp;title=Advanced_Platformer_Physics"/>
	<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Advanced_Platformer_Physics&amp;action=history"/>
	<updated>2026-10-07T11:09:54Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>http://digida.mgpu.ru/index.php?title=Advanced_Platformer_Physics&amp;diff=13277&amp;oldid=prev</id>
		<title>Patarakin в 07:10, 11 ноября 2023</title>
		<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Advanced_Platformer_Physics&amp;diff=13277&amp;oldid=prev"/>
		<updated>2023-11-11T07:10:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&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;Версия от 10:10, 11 ноября 2023&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-l1&quot;&gt;Строка 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 1:&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;/div&gt;&lt;/td&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: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Scripting Tutorials&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&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: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|Description=Как мы имитируем физические свойства внутри Scratch&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&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: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|Field_of_knowledge=Физика, Game design&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&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: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|Возрастная категория=14&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&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: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|Environment=Scratch&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&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: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;}}&lt;/ins&gt;&lt;/div&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;A platformer is a type of game distinguished by jumping across platforms and avoiding obstacles. In order to make the game realistic, more advanced scripting must be used.&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;A platformer is a type of game distinguished by jumping across platforms and avoiding obstacles. In order to make the game realistic, more advanced scripting must be used.&lt;/div&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;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;/table&gt;</summary>
		<author><name>Patarakin</name></author>
	</entry>
	<entry>
		<id>http://digida.mgpu.ru/index.php?title=Advanced_Platformer_Physics&amp;diff=2078&amp;oldid=prev</id>
		<title>Patarakin в 12:11, 8 августа 2022</title>
		<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Advanced_Platformer_Physics&amp;diff=2078&amp;oldid=prev"/>
		<updated>2022-08-08T12:11:47Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&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;Версия от 15:11, 8 августа 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-l1&quot;&gt;Строка 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 1:&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;{{April Fools}}&lt;/del&gt;&lt;/div&gt;&lt;/td&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: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &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;{{about|advanced platformer physics|a basic platformer tutorial|How to Make a Basic Platformer|scrolling platformers|Scrolling Platformer Tutorial}}&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;&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;A platformer is a type of game distinguished by jumping across platforms and avoiding obstacles. In order to make the game realistic, more advanced scripting must be used.&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;A platformer is a type of game distinguished by jumping across platforms and avoiding obstacles. In order to make the game realistic, more advanced scripting must be used.&lt;/div&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;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;/table&gt;</summary>
		<author><name>Patarakin</name></author>
	</entry>
	<entry>
		<id>http://digida.mgpu.ru/index.php?title=Advanced_Platformer_Physics&amp;diff=1692&amp;oldid=prev</id>
		<title>Patarakin: 1 версия импортирована</title>
		<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Advanced_Platformer_Physics&amp;diff=1692&amp;oldid=prev"/>
		<updated>2022-07-21T08:33:14Z</updated>

		<summary type="html">&lt;p&gt;1 версия импортирована&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&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_Platformer_Physics&amp;diff=1691&amp;oldid=prev</id>
		<title>scratch&gt;CrazyBoy826: /* Y movement */ remove in progress</title>
		<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Advanced_Platformer_Physics&amp;diff=1691&amp;oldid=prev"/>
		<updated>2022-07-12T20:38:19Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Y movement: &lt;/span&gt; remove in progress&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{April Fools}}&lt;br /&gt;
{{about|advanced platformer physics|a basic platformer tutorial|How to Make a Basic Platformer|scrolling platformers|Scrolling Platformer Tutorial}}&lt;br /&gt;
A platformer is a type of game distinguished by jumping across platforms and avoiding obstacles. In order to make the game realistic, more advanced scripting must be used.&lt;br /&gt;
&lt;br /&gt;
== Y movement ==&lt;br /&gt;
Because advanced simulations for platformers take more blocks of code, condensing it to a single custom block can simplify the script. A custom block, ticked &amp;#039;&amp;#039;&amp;#039;run without screen refresh&amp;#039;&amp;#039;&amp;#039; is needed.&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;define Platforming Scripts: Jump Height (J.H) max speed: (M.S) Acceleration: (A) friction: (F) Wall Jump X: (W.J.X) Wall Jump Y: (W.J.Y)&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
To make for realistic gravity, the amount the player moves down in will increase the longer the player is in the air. 1 variable is needed to store the value the player will move down by : &amp;lt;scratchblocks&amp;gt;(Yvel)//This stores the speed the player will move down by.&lt;br /&gt;
define Platforming Scripts: Jump Height (J.H) max speed: (M.S) Acceleration: (A) friction: (F) Wall Jump X: (W.J.X) Wall Jump Y: (W.J.Y)&lt;br /&gt;
change y by (Yvel)&lt;br /&gt;
change [Yvel v] by (-2)&lt;br /&gt;
if &amp;lt;(Yvel)&amp;lt;[-22]&amp;gt; then&lt;br /&gt;
set [Yvel v] to (-22) // this caps the player&amp;#039;s max speed to -22&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Y-Collisions ===&lt;br /&gt;
In order for the player to collide with another entity like the level, the player needs to be pushed out of the level one pixel at a time until the player is out of the collision. To determine if the player collided with a ceiling, the player must check if the collision occurred during a jump, or when the &amp;quot;Yvel&amp;quot; variable is positive. If it is a ceiling collision, the player will be pushed out of the level downwards: &amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
define Platforming Scripts: Jump Height (J.H) max speed: (M.S) Acceleration: (A) friction: (F) Wall Jump X: (W.J.X) Wall Jump Y: (W.J.Y)&lt;br /&gt;
change y by (Yvel)&lt;br /&gt;
change [Yvel v] by (-2)&lt;br /&gt;
if &amp;lt;(Yvel)&amp;lt;[-22]&amp;gt; then&lt;br /&gt;
set [Yvel v] to (-22)&lt;br /&gt;
end&lt;br /&gt;
if &amp;lt;touching [level v]&amp;gt; then&lt;br /&gt;
repeat until &amp;lt;not&amp;lt;touching [level v]&amp;gt;&amp;gt;&lt;br /&gt;
change y by ((([abs v] of (Yvel))/(Yvel))*(-1)) // this slowly pushes the player out of the collision on the y-axis.&lt;br /&gt;
end&lt;br /&gt;
set [Yvel v] to (0) // Sets the speed back to 0&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Jumping ===&lt;br /&gt;
Coding [[Jumping]] for the player requires the Yvel variable to be set to a positive value. However, the player must only jump when it collides the level.&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
define Platforming Scripts: Jump Height (J.H) max speed: (M.S) Acceleration: (A) friction: (F) Wall Jump X: (W.J.X) Wall Jump Y: (W.J.Y)&lt;br /&gt;
change y by (Yvel)&lt;br /&gt;
change [Yvel v] by (-2)&lt;br /&gt;
if &amp;lt;(Yvel)&amp;lt;[-22]&amp;gt; then&lt;br /&gt;
set [Yvel v] to (-22)&lt;br /&gt;
end&lt;br /&gt;
if &amp;lt;touching [level v]&amp;gt; then&lt;br /&gt;
repeat until &amp;lt;not&amp;lt;touching [level v]&amp;gt;&amp;gt;&lt;br /&gt;
change y by ((([abs v] of (Yvel))/(Yvel))*(-1)) // this slowly pushes the player out of the collision on the y-axis.&lt;br /&gt;
end&lt;br /&gt;
set [Yvel v] to (0)&lt;br /&gt;
if &amp;lt;&amp;lt;key [up arrow v] pressed?&amp;gt; or &amp;lt;key [w v] pressed?&amp;gt; &amp;gt; then&lt;br /&gt;
set [Yvel v] to (J.H) // Jump height can be set to any positive value&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Fixing the stick to the ceiling bug===&lt;br /&gt;
When the player collides with the ceiling and is still jumping, the player has a tendency to stick to the ceiling. To fix this, the player must only jump when the player is falling. A variable is needed to describe the direction the player is moving on the y-axis:&amp;lt;scratchblocks&amp;gt;(Ydir)&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
Integrate the &amp;quot;Ydir&amp;quot; variable in the platforming script: &amp;lt;scratchblocks&amp;gt;define Platforming Scripts: Jump Height (J.H) max speed: (M.S) Acceleration: (A) friction: (F) Wall Jump X: (W.J.X) Wall Jump Y: (W.J.Y)&lt;br /&gt;
change y by (Yvel)&lt;br /&gt;
change [Yvel v] by (-2)&lt;br /&gt;
set [Ydir v] to (([abs v] of (Yvel))/(Yvel)) // this quantifies the direction the player is moving on the y-axis&lt;br /&gt;
if &amp;lt;(Yvel)&amp;lt;[-22]&amp;gt; then&lt;br /&gt;
set [Yvel v] to (-22)&lt;br /&gt;
end&lt;br /&gt;
if &amp;lt;touching [level v]&amp;gt; then&lt;br /&gt;
repeat until &amp;lt;not&amp;lt;touching [level v]&amp;gt;&amp;gt;&lt;br /&gt;
change y by ((([abs v] of (Yvel))/(Yvel))*(-1)) // this slowly pushes the player out of the collision on the y-axis.&lt;br /&gt;
end&lt;br /&gt;
set [Yvel v] to (0)&lt;br /&gt;
if &amp;lt;&amp;lt;&amp;lt;key [up arrow v] pressed?&amp;gt; or &amp;lt;key [w v] pressed?&amp;gt;&amp;gt; and &amp;lt;(Ydir)&amp;lt;[0]&amp;gt; &amp;gt; then // Checks if the player is moving down when jumping&lt;br /&gt;
set [Yvel v] to (J.H) // Jump height can be set to any positive value&lt;br /&gt;
end&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== X movement ==&lt;br /&gt;
The movement along the x-axis requires more code, as acceleration, friction, and side collisions are needed. The velocity of the player moving on the x-axis will be stored as a variable, called &amp;quot;Xvel&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
== Hitboxes ==&lt;br /&gt;
{{main|Hitbox}}&lt;br /&gt;
If your player, avatar, etc. has arms, they will catch on the platforms (if your player is a smooth rectangle you can skip this). The answer to that is a hitbox. Create a new costume for your sprite and make it a filled rectangle about the size of your normal costume (the one it&amp;#039;s showing). Then update your scripts like this:&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
when gf clicked&lt;br /&gt;
forever&lt;br /&gt;
switch costume to (hitbox v)&lt;br /&gt;
... //other scripts&lt;br /&gt;
switch costume to (regular v)&lt;br /&gt;
end&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Walking Momentum ==&lt;br /&gt;
To simulate momentum, it needs a gliding effect - after you stop pressing the left/right key, it &amp;quot;glides&amp;quot; to a stop instead of stopping right away. First, update the &amp;quot;move&amp;quot; block - &amp;#039;&amp;#039;&amp;#039;replace&amp;#039;&amp;#039;&amp;#039; the &amp;quot;change x&amp;quot; block with a &amp;quot;change speed x&amp;quot; block&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
define move (dist)&lt;br /&gt;
change [speed x v] by (dist) //replace with this&lt;br /&gt;
... //the other scripts&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
Then, after the &amp;quot;check ground touch&amp;quot; block, add:&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
when gf clicked&lt;br /&gt;
forever&lt;br /&gt;
switch costume to (hitbox v)&lt;br /&gt;
change [speed y v] by [-1]&lt;br /&gt;
change y by (speed y)&lt;br /&gt;
check ground touch::custom&lt;br /&gt;
set [speed x v] to ((speed x)*(0.8)) //add this!&lt;br /&gt;
change x by (speed x) //and this!&lt;br /&gt;
...&lt;br /&gt;
end&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What this does is slowly (but not too slowly) speed up when you are pressing&lt;br /&gt;
the key, and slowly lose speed when you let go.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Platformer]]&lt;br /&gt;
* [[How to Make a Basic Platformer]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Design Tutorials]]&lt;br /&gt;
[[Category:Scripting Tutorials]]&lt;/div&gt;</summary>
		<author><name>scratch&gt;CrazyBoy826</name></author>
	</entry>
</feed>