<?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=Driving_Engine</id>
	<title>Driving Engine - История изменений</title>
	<link rel="self" type="application/atom+xml" href="http://digida.mgpu.ru/index.php?action=history&amp;feed=atom&amp;title=Driving_Engine"/>
	<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Driving_Engine&amp;action=history"/>
	<updated>2026-06-11T03:52:33Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>http://digida.mgpu.ru/index.php?title=Driving_Engine&amp;diff=1780&amp;oldid=prev</id>
		<title>Patarakin: 1 версия импортирована</title>
		<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Driving_Engine&amp;diff=1780&amp;oldid=prev"/>
		<updated>2022-07-21T08:33:16Z</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=Driving_Engine&amp;diff=1779&amp;oldid=prev</id>
		<title>scratch&gt;Firebird1o1: /* Scrollable Engine */</title>
		<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Driving_Engine&amp;diff=1779&amp;oldid=prev"/>
		<updated>2020-05-14T16:15:32Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Scrollable Engine&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Wiki Standards|Needs more descriptions|date=May 2020}}&lt;br /&gt;
A driving engine is used in a variety of racing [[Game Projects|games]], and can be very easy to replicate. There are two main ways that top-down driving works- in a non-scrollable world and a [[Scrolling (sprites)|scrollable]] world. For the non-scrollable driving engine, only 1 script is needed.&lt;br /&gt;
&lt;br /&gt;
==Non-scrollable Engine==&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
when gf clicked&lt;br /&gt;
go to x: (0) y: (0) // reset position&lt;br /&gt;
point in direction (90) // reset direction&lt;br /&gt;
set [turn v] to (0) // reset on flag click&lt;br /&gt;
set [velocity v] to (0) // reset on flag click&lt;br /&gt;
forever&lt;br /&gt;
if &amp;lt;(0) &amp;lt; (velocity)&amp;gt; then // if sprite moving forward&lt;br /&gt;
if &amp;lt;key [left arrow v] pressed?&amp;gt; then&lt;br /&gt;
change [turn v] by (-0.75) // affect direction negatively&lt;br /&gt;
change [velocity v] by (-0.15) // slow down forward movement on turn&lt;br /&gt;
end&lt;br /&gt;
if &amp;lt;key [right arrow v] pressed?&amp;gt; then&lt;br /&gt;
change [turn v] by (.75) // affect direction positively&lt;br /&gt;
change [velocity v] by (-0.15) // slow down forward movement on turn&lt;br /&gt;
end&lt;br /&gt;
else// if movement speed negative&lt;br /&gt;
if &amp;lt;key [left arrow v] pressed?&amp;gt; then&lt;br /&gt;
change [turn v] by (.75) // turn opposite direction, as with real cars&lt;br /&gt;
change [velocity v] by (.15) // slow down backward movement on turn&lt;br /&gt;
end&lt;br /&gt;
if &amp;lt;key [right arrow v] pressed?&amp;gt; then&lt;br /&gt;
change [turn v] by (-0.75) // turn opposite direction, as with real cars&lt;br /&gt;
change [velocity v] by (.15) // slow down backward movement on turn&lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
if &amp;lt;key [up arrow v] pressed?&amp;gt; then&lt;br /&gt;
change [velocity v] by (.5) // move forward&lt;br /&gt;
end&lt;br /&gt;
if &amp;lt;key [down arrow v] pressed?&amp;gt; then&lt;br /&gt;
change [velocity v] by (-0.5) // move backward&lt;br /&gt;
end&lt;br /&gt;
set [turn v] to  ((turn) * (.9)) // gradually slow down, as in real physics&lt;br /&gt;
turn right (turn) degrees // set turn to control the sprite&amp;#039;s direction&lt;br /&gt;
set [velocity v] to  ((velocity) * (.9)) // gradually slow down, as in real physics&lt;br /&gt;
move (velocity) steps // set velocity to control the sprite&amp;#039;s position&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Scrollable Engine==&lt;br /&gt;
The main difference between the scrollable driving engine and the non-scrollable driving engine is that a non-scrollable driving engine is good for one computer, two player games, while a scrollable engine is primarily used in one player or online, cloud-based games.The  scrollable driving engine requires two sprites- car and road- and as such, two separate [[script]]s. The first one is very similar to the non-scrollable script.&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
when gf clicked&lt;br /&gt;
go to x: (0) y: (0) // reset position&lt;br /&gt;
point in direction (90) // reset direction&lt;br /&gt;
set [turn v] to (0) // reset on flag click&lt;br /&gt;
set [velocity v] to (0) // reset on flag click&lt;br /&gt;
forever&lt;br /&gt;
if &amp;lt;(0) &amp;lt; (velocity)&amp;gt; then // if sprite moving forward&lt;br /&gt;
if &amp;lt;key [left arrow v] pressed?&amp;gt; then&lt;br /&gt;
change [turn v] by (.75) // affect direction positively&lt;br /&gt;
change [velocity v] by (-0.15) // slow down forward movement on turn&lt;br /&gt;
end&lt;br /&gt;
if &amp;lt;key [right arrow v] pressed?&amp;gt; then&lt;br /&gt;
change [turn v] by (-0.75) // affect direction negatively&lt;br /&gt;
change [velocity v] by (-0.15) // slow down forward movement on turn&lt;br /&gt;
end&lt;br /&gt;
else// if movement speed negative&lt;br /&gt;
if &amp;lt;key [left arrow v] pressed?&amp;gt; then&lt;br /&gt;
change [turn v] by (-0.75) // turn opposite direction, as with real cars&lt;br /&gt;
change [velocity v] by (.15) // slow down backward movement on turn&lt;br /&gt;
end&lt;br /&gt;
if &amp;lt;key [right arrow v] pressed?&amp;gt; then&lt;br /&gt;
change [turn v] by (.75) // turn opposite direction, as with real cars&lt;br /&gt;
change [velocity v] by (.15) // slow down backward movement on turn&lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
if &amp;lt;key [up arrow v] pressed?&amp;gt; then&lt;br /&gt;
change [velocity v] by (.5) // move forward&lt;br /&gt;
end&lt;br /&gt;
if &amp;lt;key [down arrow v] pressed?&amp;gt; then&lt;br /&gt;
change [velocity v] by (-0.5) // move backward&lt;br /&gt;
end&lt;br /&gt;
set [turn v] to  ((turn) * (.9)) // gradually slow down, as in real physics&lt;br /&gt;
set [velocity v] to  ((velocity) * (.9)) // gradually slow down, as in real physics&lt;br /&gt;
move (velocity) steps // set velocity to control the sprite&amp;#039;s position&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
Here is the script that controls the movement of the &amp;#039;road&amp;#039; the car is driving on. {{note|Remember that it must be a [[sprite]], not a [[backdrop]].}}&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
when gf clicked&lt;br /&gt;
set rotation style [don&amp;#039;t rotate v]&lt;br /&gt;
go to x: (0) y: (0) // reset position&lt;br /&gt;
forever&lt;br /&gt;
move ((0) - (velocity)) steps// move opposite direction of velocity&lt;br /&gt;
point in direction ([direction v] of [car v]) // point in direction of car&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Physics (disambiguation)]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Tutorials]]&lt;/div&gt;</summary>
		<author><name>scratch&gt;Firebird1o1</name></author>
	</entry>
</feed>