<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Writing a game in Python with Pygame. Part II</title>
	<atom:link href="http://eli.thegreenplace.net/2008/12/20/writing-a-game-in-python-with-pygame-part-ii/feed/" rel="self" type="application/rss+xml" />
	<link>http://eli.thegreenplace.net/2008/12/20/writing-a-game-in-python-with-pygame-part-ii/</link>
	<description>Eli Bendersky's personal website</description>
	<lastBuildDate>Wed, 28 Jul 2010 12:22:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: ElephantInc</title>
		<link>http://eli.thegreenplace.net/2008/12/20/writing-a-game-in-python-with-pygame-part-ii/comment-page-1/#comment-232008</link>
		<dc:creator>ElephantInc</dc:creator>
		<pubDate>Thu, 03 Dec 2009 22:42:04 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=1238#comment-232008</guid>
		<description>When ever I run this I get the error: AttributeError: &#039;str&#039; object has no attribute &#039;get_rect&#039;
this is referring to to the line:  img_rect = tile_img.get_rect()
Im using python 2.5.2 and the latest version of pygame on mac OSX 10.4.11
What could the problem be? (it occurs in both your code and mine)</description>
		<content:encoded><![CDATA[<p>When ever I run this I get the error: AttributeError: &#8217;str&#8217; object has no attribute &#8216;get_rect&#8217;<br />
this is referring to to the line:  img_rect = tile_img.get_rect()<br />
Im using python 2.5.2 and the latest version of pygame on mac OSX 10.4.11<br />
What could the problem be? (it occurs in both your code and mine)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trainer Dan</title>
		<link>http://eli.thegreenplace.net/2008/12/20/writing-a-game-in-python-with-pygame-part-ii/comment-page-1/#comment-185895</link>
		<dc:creator>Trainer Dan</dc:creator>
		<pubDate>Fri, 24 Jul 2009 20:11:09 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=1238#comment-185895</guid>
		<description>Eli

This is great. So detailed and yet very clearly explained. I&#039;ve said it before and I&#039;ll say it again. You should be a trainer. The way you write shows you have a natural empathy with learners. That&#039;s a gift not everyone has.

Ben</description>
		<content:encoded><![CDATA[<p>Eli</p>
<p>This is great. So detailed and yet very clearly explained. I&#8217;ve said it before and I&#8217;ll say it again. You should be a trainer. The way you write shows you have a natural empathy with learners. That&#8217;s a gift not everyone has.</p>
<p>Ben</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jeff (Game Talk)</title>
		<link>http://eli.thegreenplace.net/2008/12/20/writing-a-game-in-python-with-pygame-part-ii/comment-page-1/#comment-157461</link>
		<dc:creator>jeff (Game Talk)</dc:creator>
		<pubDate>Mon, 23 Feb 2009 08:28:21 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=1238#comment-157461</guid>
		<description>Thank you very much great video game.</description>
		<content:encoded><![CDATA[<p>Thank you very much great video game.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach</title>
		<link>http://eli.thegreenplace.net/2008/12/20/writing-a-game-in-python-with-pygame-part-ii/comment-page-1/#comment-149184</link>
		<dc:creator>Zach</dc:creator>
		<pubDate>Tue, 30 Dec 2008 16:46:31 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=1238#comment-149184</guid>
		<description>great tutorial... a week ago i decided i wanted to learn this sort of thing, a quick google search and i find this great guide :-)

keep up the good work!</description>
		<content:encoded><![CDATA[<p>great tutorial&#8230; a week ago i decided i wanted to learn this sort of thing, a quick google search and i find this great guide <img src='http://eli.thegreenplace.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>keep up the good work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron</title>
		<link>http://eli.thegreenplace.net/2008/12/20/writing-a-game-in-python-with-pygame-part-ii/comment-page-1/#comment-147625</link>
		<dc:creator>Aaron</dc:creator>
		<pubDate>Mon, 22 Dec 2008 23:40:04 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=1238#comment-147625</guid>
		<description>@Andre: Just a note of clarification for those learning python:

the expression &quot;(x, y, z) = 1, 2, 3&quot; is not a tuple being assigned to a tuple... it&#039;s a tuple (on the right hand side) being assigned in a multiple assignment statement.  

Python evaluates variables immediately, so in an _expression_, &quot;x,y,z&quot; will immediately evaluate the present value of x, and the other variables, and store the results in a tuple... once stored in the tuple, the tuple no longer refers to the variable x in any way, so it can&#039;t, for instance, assign something back to x.

Feel free to try this out at the interactive prompt:
`&lt;code&gt;__abENT__gt;__abENT__gt;__abENT__gt; x,y,z = 1,2,3
__abENT__gt;__abENT__gt;__abENT__gt; x
1
__abENT__gt;__abENT__gt;__abENT__gt; tup = x,y,z
__abENT__gt;__abENT__gt;__abENT__gt; tup
(1, 2, 3)
__abENT__gt;__abENT__gt;__abENT__gt; tup = 7,8,9
__abENT__gt;__abENT__gt;__abENT__gt; x
1
__abENT__gt;__abENT__gt;__abENT__gt; *tup = 7,8,9
  File __abENT__quot;__abENT__lt;stdin__abENT__gt;__abENT__quot;, line 1
    *tup = 7,8,9
    ^
SyntaxError: invalid syntax
__abENT__gt;__abENT__gt;__abENT__gt;&lt;/code&gt;`</description>
		<content:encoded><![CDATA[<p>@Andre: Just a note of clarification for those learning python:</p>
<p>the expression &#8220;(x, y, z) = 1, 2, 3&#8243; is not a tuple being assigned to a tuple&#8230; it&#8217;s a tuple (on the right hand side) being assigned in a multiple assignment statement.  </p>
<p>Python evaluates variables immediately, so in an _expression_, &#8220;x,y,z&#8221; will immediately evaluate the present value of x, and the other variables, and store the results in a tuple&#8230; once stored in the tuple, the tuple no longer refers to the variable x in any way, so it can&#8217;t, for instance, assign something back to x.</p>
<p>Feel free to try this out at the interactive prompt:<br />
<code class="backtick">&gt;&gt;&gt; x,y,z = 1,2,3<br />
&gt;&gt;&gt; x<br />
1<br />
&gt;&gt;&gt; tup = x,y,z<br />
&gt;&gt;&gt; tup<br />
(1, 2, 3)<br />
&gt;&gt;&gt; tup = 7,8,9<br />
&gt;&gt;&gt; x<br />
1<br />
&gt;&gt;&gt; *tup = 7,8,9<br />
  File &quot;&lt;stdin&gt;&quot;, line 1<br />
    *tup = 7,8,9<br />
    ^<br />
SyntaxError: invalid syntax<br />
&gt;&gt;&gt;</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: André Roberge</title>
		<link>http://eli.thegreenplace.net/2008/12/20/writing-a-game-in-python-with-pygame-part-ii/comment-page-1/#comment-147020</link>
		<dc:creator>André Roberge</dc:creator>
		<pubDate>Sat, 20 Dec 2008 13:30:28 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=1238#comment-147020</guid>
		<description>Nice series!   

A small nit: you don&#039;t need the parentheses when assigning the states.  You can simply write

ALIVE, EXPLODING, DEAD = range(3)

or you can skip range altogether and write

ALIVE, EXPLODING, DEAD = 0, 1, 2

which may be less confusing to Python beginners since range() returns a list (before Python 3.0) and we have tuple being seemingly made equal to a list object.</description>
		<content:encoded><![CDATA[<p>Nice series!   </p>
<p>A small nit: you don&#8217;t need the parentheses when assigning the states.  You can simply write</p>
<p>ALIVE, EXPLODING, DEAD = range(3)</p>
<p>or you can skip range altogether and write</p>
<p>ALIVE, EXPLODING, DEAD = 0, 1, 2</p>
<p>which may be less confusing to Python beginners since range() returns a list (before Python 3.0) and we have tuple being seemingly made equal to a list object.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
