<?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=Simple_Animation</id>
		<title>Simple Animation - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://fingswotidun.com/code/index.php?action=history&amp;feed=atom&amp;title=Simple_Animation"/>
		<link rel="alternate" type="text/html" href="https://fingswotidun.com/code/index.php?title=Simple_Animation&amp;action=history"/>
		<updated>2026-11-15T19:16:26Z</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=Simple_Animation&amp;diff=154&amp;oldid=prev</id>
		<title>Lerc: moved Simple animation to Simple Animation</title>
		<link rel="alternate" type="text/html" href="https://fingswotidun.com/code/index.php?title=Simple_Animation&amp;diff=154&amp;oldid=prev"/>
				<updated>2012-01-31T01:27:06Z</updated>
		
		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/code/index.php/Simple_animation&quot; class=&quot;mw-redirect&quot; title=&quot;Simple animation&quot;&gt;Simple animation&lt;/a&gt; to &lt;a href=&quot;/code/index.php/Simple_Animation&quot; title=&quot;Simple Animation&quot;&gt;Simple Animation&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:27, 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=Simple_Animation&amp;diff=141&amp;oldid=prev</id>
		<title>Lerc: Created page with &quot;When loading an image, you have the option of specifying if there are multiple frames of animation in the image.  Often animations will be stored in a single image as a horizo...&quot;</title>
		<link rel="alternate" type="text/html" href="https://fingswotidun.com/code/index.php?title=Simple_Animation&amp;diff=141&amp;oldid=prev"/>
				<updated>2012-01-30T03:32:35Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;When loading an image, you have the option of specifying if there are multiple frames of animation in the image.  Often animations will be stored in a single image as a horizo...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;When loading an image, you have the option of specifying if there are multiple frames of animation in the image.  Often animations will be stored in a single image as a horizontal or vertical strip or even arrayed in a grid.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;loadImage&amp;lt;/tt&amp;gt; function lets you specify how many frames across and down there are in an image.&lt;br /&gt;
&lt;br /&gt;
In this example &amp;lt;tt&amp;gt;loadImage(&amp;quot;Gus_Running_Left_Small.png&amp;quot;,1,18);&amp;lt;/tt&amp;gt; says that the image should be treated as an animation 1 frame wide and 18 frames high. The &amp;lt;tt&amp;gt;drawImage&amp;lt;/tt&amp;gt; has an extra parameter to say which frame of animation to use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;edcode&amp;gt;&lt;br /&gt;
var ty=400;&lt;br /&gt;
var tx=10;&lt;br /&gt;
var dx=3;&lt;br /&gt;
&lt;br /&gt;
var runLeft = loadImage(&amp;quot;Gus_Running_Left_Small.png&amp;quot;,1,18);&lt;br /&gt;
var runRight = loadImage(&amp;quot;Gus_Running_Right_Small.png&amp;quot;,1,18);&lt;br /&gt;
&lt;br /&gt;
var runAnim = runRight;&lt;br /&gt;
var animFrame = 0;&lt;br /&gt;
&lt;br /&gt;
function move() {&lt;br /&gt;
  tx+=dx;&lt;br /&gt;
  if (tx&amp;gt;600) {&lt;br /&gt;
      dx=-3;&lt;br /&gt;
      runAnim=runLeft;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  if (tx&amp;lt;30) {&lt;br /&gt;
      dx=3;&lt;br /&gt;
      runAnim=runRight;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
  if (keyIsDown(38)) ty-=3;&lt;br /&gt;
  if (keyIsDown(40)) ty+=3;&lt;br /&gt;
&lt;br /&gt;
  animFrame=(animFrame+1)%18;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function draw() {&lt;br /&gt;
  clear();&lt;br /&gt;
  drawImage(runAnim,tx,ty,animFrame);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
run(move,draw);&lt;br /&gt;
&amp;lt;/edcode&amp;gt;&lt;br /&gt;
[[File:Gus_Running_Left_Small.png|left]] [[File:Gus_Running_Right_Small.png|right]]&lt;/div&gt;</summary>
		<author><name>Lerc</name></author>	</entry>

	</feed>