<?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: Exercise 9-7: Snake as object</title>
	<atom:link href="http://www.learningprocessing.com/exercises/chapter-9/exercise-9-7/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learningprocessing.com</link>
	<description>A Beginner's Guide to Programming Images, Animation, and Interaction by Daniel Shiffman</description>
	<lastBuildDate>Thu, 09 Feb 2012 16:27:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Maggie</title>
		<link>http://www.learningprocessing.com/exercises/chapter-9/exercise-9-7/comment-page-1/#comment-20632</link>
		<dc:creator>Maggie</dc:creator>
		<pubDate>Tue, 18 Oct 2011 12:38:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningprocessing.com/?page_id=922#comment-20632</guid>
		<description>Oh nevermind!  I just realized there&#039;s two different tabs</description>
		<content:encoded><![CDATA[<p>Oh nevermind!  I just realized there&#8217;s two different tabs</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maggie</title>
		<link>http://www.learningprocessing.com/exercises/chapter-9/exercise-9-7/comment-page-1/#comment-20631</link>
		<dc:creator>Maggie</dc:creator>
		<pubDate>Tue, 18 Oct 2011 12:20:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningprocessing.com/?page_id=922#comment-20631</guid>
		<description>could you please provide the full example?
thanks!</description>
		<content:encoded><![CDATA[<p>could you please provide the full example?<br />
thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johan Hess</title>
		<link>http://www.learningprocessing.com/exercises/chapter-9/exercise-9-7/comment-page-1/#comment-15462</link>
		<dc:creator>Johan Hess</dc:creator>
		<pubDate>Tue, 16 Nov 2010 06:36:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningprocessing.com/?page_id=922#comment-15462</guid>
		<description>ok I have just read chapter 10, where i found the solution: ellipse(points[i].x, points[i].y,i,i)

thank you regardless :)</description>
		<content:encoded><![CDATA[<p>ok I have just read chapter 10, where i found the solution: ellipse(points[i].x, points[i].y,i,i)</p>
<p>thank you regardless <img src='http://www.learningprocessing.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johan Hess</title>
		<link>http://www.learningprocessing.com/exercises/chapter-9/exercise-9-7/comment-page-1/#comment-15461</link>
		<dc:creator>Johan Hess</dc:creator>
		<pubDate>Tue, 16 Nov 2010 04:54:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningprocessing.com/?page_id=922#comment-15461</guid>
		<description>In the advanced problem how do you draw the &#039;ellipses&#039; with the new array of Point objects?

The &#039;xpos&#039; and &#039;ypos&#039; arrays can be directly used as arguments for the ellipse: ellipse(xpos[i],ypos[i],i,i),
but with the Point object i cant see how this is possible, as ellipse obviously dosnt work with: ellipse(points[i],points[i],i,i).

do you need to decipher the x and y value from the points object so that you are able to use them seperately within the ellipse object, and if so, how is that done?
or is some larger change needed to make it work?</description>
		<content:encoded><![CDATA[<p>In the advanced problem how do you draw the &#8216;ellipses&#8217; with the new array of Point objects?</p>
<p>The &#8216;xpos&#8217; and &#8216;ypos&#8217; arrays can be directly used as arguments for the ellipse: ellipse(xpos[i],ypos[i],i,i),<br />
but with the Point object i cant see how this is possible, as ellipse obviously dosnt work with: ellipse(points[i],points[i],i,i).</p>
<p>do you need to decipher the x and y value from the points object so that you are able to use them seperately within the ellipse object, and if so, how is that done?<br />
or is some larger change needed to make it work?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Shiffman</title>
		<link>http://www.learningprocessing.com/exercises/chapter-9/exercise-9-7/comment-page-1/#comment-15202</link>
		<dc:creator>Daniel Shiffman</dc:creator>
		<pubDate>Wed, 10 Nov 2010 16:13:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningprocessing.com/?page_id=922#comment-15202</guid>
		<description>First you need a simple Point class, which could look like so:

&lt;pre&gt;
class Point {
  float x;
  float y;
 
   Point(float x_, float y_) {
     x = x_;
     y = y_;
  }
}
&lt;/pre&gt;

Once you have this then your Snake class only needs one array of &quot;Point&quot; objects, rather than two separate x and y arrays.

&lt;pre&gt;
 class Snake {
  // x and y positions
  Point[] points;

  // etc.
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>First you need a simple Point class, which could look like so:</p>
<pre>
class Point {
  float x;
  float y;

   Point(float x_, float y_) {
     x = x_;
     y = y_;
  }
}
</pre>
<p>Once you have this then your Snake class only needs one array of &#8220;Point&#8221; objects, rather than two separate x and y arrays.</p>
<pre>
 class Snake {
  // x and y positions
  Point[] points;

  // etc.
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: marisaurus</title>
		<link>http://www.learningprocessing.com/exercises/chapter-9/exercise-9-7/comment-page-1/#comment-15176</link>
		<dc:creator>marisaurus</dc:creator>
		<pubDate>Tue, 09 Nov 2010 13:07:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningprocessing.com/?page_id=922#comment-15176</guid>
		<description>In the book, you have an addition to this exercise, concerning the use of a Pt class that would be called into the Snake class. Is it possible to post how to do this? 

thanks.</description>
		<content:encoded><![CDATA[<p>In the book, you have an addition to this exercise, concerning the use of a Pt class that would be called into the Snake class. Is it possible to post how to do this? </p>
<p>thanks.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

