<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://fingswotidun.com/code/index.php?action=history&amp;feed=atom&amp;title=Move_Draw_Loop</id>
		<title>Move Draw Loop - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://fingswotidun.com/code/index.php?action=history&amp;feed=atom&amp;title=Move_Draw_Loop"/>
		<link rel="alternate" type="text/html" href="https://fingswotidun.com/code/index.php?title=Move_Draw_Loop&amp;action=history"/>
		<updated>2026-07-23T15:25:29Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.24.2</generator>

	<entry>
		<id>https://fingswotidun.com/code/index.php?title=Move_Draw_Loop&amp;diff=152&amp;oldid=prev</id>
		<title>Lerc: moved Move Draw loop to Move Draw Loop</title>
		<link rel="alternate" type="text/html" href="https://fingswotidun.com/code/index.php?title=Move_Draw_Loop&amp;diff=152&amp;oldid=prev"/>
				<updated>2012-01-31T01:15:53Z</updated>
		
		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/code/index.php/Move_Draw_loop&quot; class=&quot;mw-redirect&quot; title=&quot;Move Draw loop&quot;&gt;Move Draw loop&lt;/a&gt; to &lt;a href=&quot;/code/index.php/Move_Draw_Loop&quot; title=&quot;Move Draw Loop&quot;&gt;Move Draw Loop&lt;/a&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 01:15, 31 January 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan='2' style='text-align: center;'&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Lerc</name></author>	</entry>

	<entry>
		<id>https://fingswotidun.com/code/index.php?title=Move_Draw_Loop&amp;diff=143&amp;oldid=prev</id>
		<title>Lerc at 04:42, 30 January 2012</title>
		<link rel="alternate" type="text/html" href="https://fingswotidun.com/code/index.php?title=Move_Draw_Loop&amp;diff=143&amp;oldid=prev"/>
				<updated>2012-01-30T04:42:39Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 04:42, 30 January 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There are many ways to do interactive programs.&amp;#160;  The Move/Draw system shown here is often used in video games.&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There are many ways to do interactive programs.&amp;#160;  The Move/Draw system shown here is often used in video games.&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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;Two functions are set up, to do different &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;parts &lt;/del&gt;of the game.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;Two functions are set up, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;each &lt;/ins&gt;to do &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;a &lt;/ins&gt;different &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;part &lt;/ins&gt;of the game.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The move function controls what is happening.&amp;#160; User input is read and any movement of objects occur in this function.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The move function controls what is happening.&amp;#160; User input is read and any movement of objects occur in this function.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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;During the draw function everything in the game is at a standstill.&amp;#160; The job of the draw function is to put an image of the current state of the game &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;onscreen&lt;/del&gt;. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;During the draw function everything in the game is at a standstill.&amp;#160; The job of the draw function is to put an image of the current state of the game &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;on the screen&lt;/ins&gt;. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The example below makes an etch-a-sketch.&amp;#160; The move function checks the keys 37,38,39,40 (the arrow keys) and changes the variables cx and cy.&amp;#160; The draw function just draws a circle at cx,cy.&amp;#160;  The screen is never cleared so whenever the circle moves it will leave a trail.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The example below makes an etch-a-sketch.&amp;#160; The move function checks the keys 37,38,39,40 (the arrow keys) and changes the variables cx and cy.&amp;#160; The draw function just draws a circle at cx,cy.&amp;#160;  The screen is never cleared so whenever the circle moves it will leave a trail.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Lerc</name></author>	</entry>

	<entry>
		<id>https://fingswotidun.com/code/index.php?title=Move_Draw_Loop&amp;diff=142&amp;oldid=prev</id>
		<title>Lerc: Created page with &quot;There are many ways to do interactive programs.   The Move/Draw system shown here is often used in video games.    Two functions are set up, to do different parts of the game....&quot;</title>
		<link rel="alternate" type="text/html" href="https://fingswotidun.com/code/index.php?title=Move_Draw_Loop&amp;diff=142&amp;oldid=prev"/>
				<updated>2012-01-30T04:41:23Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;There are many ways to do interactive programs.   The Move/Draw system shown here is often used in video games.    Two functions are set up, to do different parts of the game....&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;There are many ways to do interactive programs.   The Move/Draw system shown here is often used in video games.  &lt;br /&gt;
&lt;br /&gt;
Two functions are set up, to do different parts of the game.&lt;br /&gt;
&lt;br /&gt;
The move function controls what is happening.  User input is read and any movement of objects occur in this function.&lt;br /&gt;
&lt;br /&gt;
During the draw function everything in the game is at a standstill.  The job of the draw function is to put an image of the current state of the game onscreen. &lt;br /&gt;
&lt;br /&gt;
The example below makes an etch-a-sketch.  The move function checks the keys 37,38,39,40 (the arrow keys) and changes the variables cx and cy.  The draw function just draws a circle at cx,cy.   The screen is never cleared so whenever the circle moves it will leave a trail.&lt;br /&gt;
&lt;br /&gt;
The last line of the program is &amp;lt;tt&amp;gt;run(move,draw)&amp;lt;/tt&amp;gt;.  The run function repeatedly calls move then draw thirty times a second. &lt;br /&gt;
&lt;br /&gt;
You may give run an optional third parameter to adjust the speed &amp;lt;tt&amp;gt;run(move,draw,60)&amp;lt;/tt&amp;gt; will make the move/draw calls 60 times a second.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;edcode&amp;gt;print(&amp;quot;draw with the arrow keys&amp;quot;);&lt;br /&gt;
var cx=320;&lt;br /&gt;
var cy=240;&lt;br /&gt;
&lt;br /&gt;
function move() {&lt;br /&gt;
  if (keyIsDown(38)) cy-=1;&lt;br /&gt;
  if (keyIsDown(40)) cy+=1;&lt;br /&gt;
  if (keyIsDown(37)) cx-=1;&lt;br /&gt;
  if (keyIsDown(39)) cx+=1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function draw() {&lt;br /&gt;
  fillCircle(cx,cy,6);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
run(move,draw);&lt;br /&gt;
&amp;lt;/edcode&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lerc</name></author>	</entry>

	</feed>