<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.sugarlabs.org/index.php?action=history&amp;feed=atom&amp;title=Development_Team%2FSugargame%2FExamples</id>
	<title>Development Team/Sugargame/Examples - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sugarlabs.org/index.php?action=history&amp;feed=atom&amp;title=Development_Team%2FSugargame%2FExamples"/>
	<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Development_Team/Sugargame/Examples&amp;action=history"/>
	<updated>2026-06-09T22:27:39Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Development_Team/Sugargame/Examples&amp;diff=46762&amp;oldid=prev</id>
		<title>Patrol: moved Walter is a wanker 12/Sugargame/Examples to Development Team/Sugargame/Examples over redirect: revert</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Development_Team/Sugargame/Examples&amp;diff=46762&amp;oldid=prev"/>
		<updated>2010-02-24T01:33:25Z</updated>

		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/index.php?title=Walter_is_a_wanker_12/Sugargame/Examples&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Walter is a wanker 12/Sugargame/Examples (page does not exist)&quot;&gt;Walter is a wanker 12/Sugargame/Examples&lt;/a&gt; to &lt;a href=&quot;/go/Development_Team/Sugargame/Examples&quot; title=&quot;Development Team/Sugargame/Examples&quot;&gt;Development Team/Sugargame/Examples&lt;/a&gt; over redirect: revert&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;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 21:33, 23 February 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&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>Patrol</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Development_Team/Sugargame/Examples&amp;diff=46655&amp;oldid=prev</id>
		<title>Page move vandal: moved Development Team/Sugargame/Examples to Walter is a wanker 12/Sugargame/Examples:&amp;#32;Walter is a wanker</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Development_Team/Sugargame/Examples&amp;diff=46655&amp;oldid=prev"/>
		<updated>2010-02-24T00:21:42Z</updated>

		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/go/Development_Team/Sugargame/Examples&quot; title=&quot;Development Team/Sugargame/Examples&quot;&gt;Development Team/Sugargame/Examples&lt;/a&gt; to &lt;a href=&quot;/index.php?title=Walter_is_a_wanker_12/Sugargame/Examples&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Walter is a wanker 12/Sugargame/Examples (page does not exist)&quot;&gt;Walter is a wanker 12/Sugargame/Examples&lt;/a&gt;: Walter is a wanker&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;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:21, 23 February 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&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>Page move vandal</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Development_Team/Sugargame/Examples&amp;diff=45621&amp;oldid=prev</id>
		<title>Patrol: moved Anal bleaching 15/Sugargame/Examples to Development Team/Sugargame/Examples over redirect: revert</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Development_Team/Sugargame/Examples&amp;diff=45621&amp;oldid=prev"/>
		<updated>2010-02-21T22:42:15Z</updated>

		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/index.php?title=Anal_bleaching_15/Sugargame/Examples&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Anal bleaching 15/Sugargame/Examples (page does not exist)&quot;&gt;Anal bleaching 15/Sugargame/Examples&lt;/a&gt; to &lt;a href=&quot;/go/Development_Team/Sugargame/Examples&quot; title=&quot;Development Team/Sugargame/Examples&quot;&gt;Development Team/Sugargame/Examples&lt;/a&gt; over redirect: revert&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;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:42, 21 February 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&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>Patrol</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Development_Team/Sugargame/Examples&amp;diff=45196&amp;oldid=prev</id>
		<title>Anal bleaching: moved Development Team/Sugargame/Examples to Anal bleaching 15/Sugargame/Examples:&amp;#32;Anal bleaching</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Development_Team/Sugargame/Examples&amp;diff=45196&amp;oldid=prev"/>
		<updated>2010-02-21T22:22:45Z</updated>

		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/go/Development_Team/Sugargame/Examples&quot; title=&quot;Development Team/Sugargame/Examples&quot;&gt;Development Team/Sugargame/Examples&lt;/a&gt; to &lt;a href=&quot;/index.php?title=Anal_bleaching_15/Sugargame/Examples&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Anal bleaching 15/Sugargame/Examples (page does not exist)&quot;&gt;Anal bleaching 15/Sugargame/Examples&lt;/a&gt;: Anal bleaching&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;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:22, 21 February 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&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>Anal bleaching</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Development_Team/Sugargame/Examples&amp;diff=40474&amp;oldid=prev</id>
		<title>Wade: /* TestGame.py */</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Development_Team/Sugargame/Examples&amp;diff=40474&amp;oldid=prev"/>
		<updated>2009-11-21T17:25:03Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;TestGame.py&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&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;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:25, 21 November 2009&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-l127&quot;&gt;Line 127:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 127:&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;                     elif event.type == pygame.VIDEORESIZE:&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;                     elif event.type == pygame.VIDEORESIZE:&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;                         pygame.display.set_mode(event.size, pygame.RESIZABLE)&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;                         pygame.display.set_mode(event.size, pygame.RESIZABLE)&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;/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; &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;                 # Move the ball&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;                 # Move the ball&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;                 if not self.paused:&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;                 if not self.paused:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Wade</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Development_Team/Sugargame/Examples&amp;diff=40473&amp;oldid=prev</id>
		<title>Wade: /* TestGame.py */</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Development_Team/Sugargame/Examples&amp;diff=40473&amp;oldid=prev"/>
		<updated>2009-11-21T17:24:44Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;TestGame.py&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&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;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:24, 21 November 2009&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-l125&quot;&gt;Line 125:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 125:&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;                     if event.type == pygame.QUIT:&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;                     if event.type == pygame.QUIT:&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;                         return&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;                         return&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;    &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;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;                    elif event.type == pygame.VIDEORESIZE:&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;                        pygame.display.set_mode(event.size, pygame.RESIZABLE)&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;/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;                 # Move the ball&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;                 # Move the ball&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;                 if not self.paused:&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;                 if not self.paused:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Wade</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Development_Team/Sugargame/Examples&amp;diff=40466&amp;oldid=prev</id>
		<title>Wade: Created page with &#039;== Bouncing Ball ==  This is a simple Sugargame example which bounces a red ball across the screen.    A Sugar toolbar provides Pause and Unpause functionality, demonstrating com…&#039;</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Development_Team/Sugargame/Examples&amp;diff=40466&amp;oldid=prev"/>
		<updated>2009-11-21T15:58:00Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;== Bouncing Ball ==  This is a simple Sugargame example which bounces a red ball across the screen.    A Sugar toolbar provides Pause and Unpause functionality, demonstrating com…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Bouncing Ball ==&lt;br /&gt;
&lt;br /&gt;
This is a simple Sugargame example which bounces a red ball across the screen.  &lt;br /&gt;
&lt;br /&gt;
A Sugar toolbar provides Pause and Unpause functionality, demonstrating communication between Sugar and Pygame.&lt;br /&gt;
&lt;br /&gt;
====TestActivity.py====&lt;br /&gt;
&lt;br /&gt;
This file implements the TestActivity activity class.  The constructor sets up the Pygame canvas and Sugar toolbar, and starts the game running.&lt;br /&gt;
&lt;br /&gt;
    from gettext import gettext as _&lt;br /&gt;
    &lt;br /&gt;
    import sys&lt;br /&gt;
    import gtk&lt;br /&gt;
    import pygame&lt;br /&gt;
    &lt;br /&gt;
    import sugar.activity.activity&lt;br /&gt;
    import sugar.graphics.toolbutton&lt;br /&gt;
    &lt;br /&gt;
    sys.path.append(&amp;#039;..&amp;#039;) # Import sugargame package from top directory.&lt;br /&gt;
    import sugargame.canvas&lt;br /&gt;
    &lt;br /&gt;
    import TestGame&lt;br /&gt;
    &lt;br /&gt;
    class TestActivity(sugar.activity.activity.Activity):&lt;br /&gt;
        def __init__(self, handle):&lt;br /&gt;
            super(TestActivity, self).__init__(handle)&lt;br /&gt;
            &lt;br /&gt;
            self.paused = False&lt;br /&gt;
    &lt;br /&gt;
            # Create the game instance.&lt;br /&gt;
            self.game = TestGame.TestGame()&lt;br /&gt;
    &lt;br /&gt;
            # Build the activity toolbar.&lt;br /&gt;
            self.build_toolbar()&lt;br /&gt;
    &lt;br /&gt;
            # Build the Pygame canvas.&lt;br /&gt;
            self._canvas = sugargame.canvas.PygameCanvas(self)&lt;br /&gt;
            # Note that set_canvas implicitly calls read_file when resuming from the Journal.&lt;br /&gt;
            self.set_canvas(self._canvas)&lt;br /&gt;
            &lt;br /&gt;
            # Start the game running.&lt;br /&gt;
            self._canvas.run_pygame(self.game.run)&lt;br /&gt;
            &lt;br /&gt;
        def build_toolbar(self):        &lt;br /&gt;
            stop_play = sugar.graphics.toolbutton.ToolButton(&amp;#039;media-playback-stop&amp;#039;)&lt;br /&gt;
            stop_play.set_tooltip(_(&amp;quot;Stop&amp;quot;))&lt;br /&gt;
            stop_play.set_accelerator(_(&amp;#039;&amp;lt;ctrl&amp;gt;space&amp;#039;))&lt;br /&gt;
            stop_play.connect(&amp;#039;clicked&amp;#039;, self._stop_play_cb)&lt;br /&gt;
    &lt;br /&gt;
            toolbar = gtk.Toolbar()&lt;br /&gt;
            toolbar.insert(stop_play, 0)&lt;br /&gt;
            toolbar.insert(gtk.SeparatorToolItem(), 1)&lt;br /&gt;
            &lt;br /&gt;
            toolbox = sugar.activity.activity.ActivityToolbox(self)&lt;br /&gt;
            toolbox.add_toolbar(_(&amp;quot;Pygame&amp;quot;), toolbar)&lt;br /&gt;
            &lt;br /&gt;
            toolbox.show_all()&lt;br /&gt;
            self.set_toolbox(toolbox)&lt;br /&gt;
    &lt;br /&gt;
        def _stop_play_cb(self, button):&lt;br /&gt;
            # Pause or unpause the game.&lt;br /&gt;
            self.paused = not self.paused&lt;br /&gt;
            self.game.set_paused(self.paused)&lt;br /&gt;
            &lt;br /&gt;
            # Update the button to show the next action.&lt;br /&gt;
            if self.paused:&lt;br /&gt;
                button.set_icon(&amp;#039;media-playback-start&amp;#039;)&lt;br /&gt;
                button.set_tooltip(_(&amp;quot;Start&amp;quot;))&lt;br /&gt;
            else:&lt;br /&gt;
                button.set_icon(&amp;#039;media-playback-stop&amp;#039;)&lt;br /&gt;
                button.set_tooltip(_(&amp;quot;Stop&amp;quot;))&lt;br /&gt;
    &lt;br /&gt;
        def read_file(self, file_path):&lt;br /&gt;
            self.game.read_file(file_path)&lt;br /&gt;
            &lt;br /&gt;
        def write_file(self, file_path):&lt;br /&gt;
            self.game.write_file(file_path)&lt;br /&gt;
&lt;br /&gt;
====TestGame.py====&lt;br /&gt;
&lt;br /&gt;
This file implements the game (really just a bouncing ball animation).  Note the main function at the end; this file can also be run as a standalone Pygame program.&lt;br /&gt;
&lt;br /&gt;
    #!/usr/bin/python&lt;br /&gt;
    import pygame&lt;br /&gt;
    import gtk&lt;br /&gt;
    &lt;br /&gt;
    class TestGame:&lt;br /&gt;
        def __init__(self):&lt;br /&gt;
            # Set up a clock for managing the frame rate.&lt;br /&gt;
            self.clock = pygame.time.Clock()&lt;br /&gt;
    &lt;br /&gt;
            self.x = -100&lt;br /&gt;
            self.y = 100&lt;br /&gt;
    &lt;br /&gt;
            self.vx = 10&lt;br /&gt;
            self.vy = 0&lt;br /&gt;
    &lt;br /&gt;
            self.paused = False&lt;br /&gt;
            &lt;br /&gt;
        def set_paused(self, paused):&lt;br /&gt;
            self.paused = paused&lt;br /&gt;
    &lt;br /&gt;
        # Called to save the state of the game to the Journal.&lt;br /&gt;
        def write_file(self, file_path):&lt;br /&gt;
            pass&lt;br /&gt;
    &lt;br /&gt;
        # Called to load the state of the game from the Journal.&lt;br /&gt;
        def read_file(self, file_path):&lt;br /&gt;
            pass&lt;br /&gt;
            &lt;br /&gt;
        # The main game loop.&lt;br /&gt;
        def run(self):&lt;br /&gt;
            self.running = True    &lt;br /&gt;
                &lt;br /&gt;
            screen = pygame.display.get_surface()&lt;br /&gt;
    &lt;br /&gt;
            while self.running:&lt;br /&gt;
                # Pump GTK messages.&lt;br /&gt;
                while gtk.events_pending():&lt;br /&gt;
                    gtk.main_iteration()&lt;br /&gt;
    &lt;br /&gt;
                # Pump PyGame messages.&lt;br /&gt;
                for event in pygame.event.get():&lt;br /&gt;
                    if event.type == pygame.QUIT:&lt;br /&gt;
                        return&lt;br /&gt;
    &lt;br /&gt;
                # Move the ball&lt;br /&gt;
                if not self.paused:&lt;br /&gt;
                    self.x += self.vx&lt;br /&gt;
                    if self.x &amp;gt; screen.get_width() + 100:&lt;br /&gt;
                        self.x = -100&lt;br /&gt;
                    &lt;br /&gt;
                    self.y += self.vy&lt;br /&gt;
                    if self.y &amp;gt; screen.get_height() - 100:&lt;br /&gt;
                        self.y = screen.get_height() - 100&lt;br /&gt;
                        self.vy = -self.vy&lt;br /&gt;
                    &lt;br /&gt;
                    self.vy += 5;&lt;br /&gt;
                &lt;br /&gt;
                # Clear Display&lt;br /&gt;
                screen.fill((255,255,255)) #255 for white&lt;br /&gt;
    &lt;br /&gt;
                # Draw the ball&lt;br /&gt;
                pygame.draw.circle(screen, (255,0,0), (self.x, self.y), 100)&lt;br /&gt;
                        &lt;br /&gt;
                # Flip Display&lt;br /&gt;
                pygame.display.flip()  &lt;br /&gt;
                &lt;br /&gt;
                # Try to stay at 30 FPS&lt;br /&gt;
                self.clock.tick(30)&lt;br /&gt;
    &lt;br /&gt;
    # This function is called when the game is run directly from the command line:&lt;br /&gt;
    # ./TestGame.py &lt;br /&gt;
    def main():&lt;br /&gt;
        pygame.init()&lt;br /&gt;
        pygame.display.set_mode((0, 0), pygame.RESIZABLE)&lt;br /&gt;
        game = TestGame() &lt;br /&gt;
        game.run()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;#039;__main__&amp;#039;:&lt;br /&gt;
        main()&lt;/div&gt;</summary>
		<author><name>Wade</name></author>
	</entry>
</feed>