<?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: Processing &#8211; (Not so) Glitchy Gravity</title>
	<atom:link href="http://www.jordanparsons.com/blog/2009/03/30/processing-glitchy-gravity/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jordanparsons.com/blog/2009/03/30/processing-glitchy-gravity/</link>
	<description>- Second Year Architect</description>
	<lastBuildDate>Fri, 07 Aug 2009 22:08:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jordan Parsons</title>
		<link>http://www.jordanparsons.com/blog/2009/03/30/processing-glitchy-gravity/comment-page-1/#comment-23</link>
		<dc:creator>Jordan Parsons</dc:creator>
		<pubDate>Tue, 31 Mar 2009 12:45:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.jordanparsons.com/blog/?p=198#comment-23</guid>
		<description>Thanks for the edits, I&#039;ll have to try them out after class today and I&#039;ll let you know how it goes.

By the way I use this for syntax highlighting.
&lt;pre class=&quot;brush: java&quot;&gt; 


&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Thanks for the edits, I&#8217;ll have to try them out after class today and I&#8217;ll let you know how it goes.</p>
<p>By the way I use this for syntax highlighting.<br />
&lt;pre class=&#8221;brush: java&#8221;&gt; </p>
<p>&lt;/pre&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adam</title>
		<link>http://www.jordanparsons.com/blog/2009/03/30/processing-glitchy-gravity/comment-page-1/#comment-22</link>
		<dc:creator>adam</dc:creator>
		<pubDate>Tue, 31 Mar 2009 06:11:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.jordanparsons.com/blog/?p=198#comment-22</guid>
		<description>arg. silly me! not escaping the &lt; &gt; and it would appear that &lt;code&amp;gt doesn&#039;t work either. let me try again.

&lt;pre class=&quot;brush: java&quot;&gt;

    if(loc.x&gt;width){
      vel.x*=-1; // change direction
      vel.x*=x_loss; // dampen the velocity
      loc.x=width; // set location to outside the collision area
    }
    if(loc.x&lt;0){  
      vel.x*=-1;
      vel.x*=x_loss;
      loc.x=(1);
    }

    if(loc.y&gt;height){
      vel.y*=-1;
      vel.y*=y_loss;
      vel.x*=x_loss; // also dampen the x movement a bit
      loc.y=height;

      // may as well only do this test when you are bouncing on the ground
      // remember that your velocities can be negative too!
      if(vel.y&lt;.9 &amp;&amp; vel.y&gt;-.9){
        if(vel.x&lt;.5 &amp;&amp; vel.x&gt;-.5){
          acc.x=0;
          vel.x=0;
          vel.y=0;         
        }
      }
    }
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>arg. silly me! not escaping the &lt; &gt; and it would appear that &lt;code&amp;gt doesn&#8217;t work either. let me try again.</p>
<pre class="brush: java">

    if(loc.x&gt;width){
      vel.x*=-1; // change direction
      vel.x*=x_loss; // dampen the velocity
      loc.x=width; // set location to outside the collision area
    }
    if(loc.x&lt;0){
      vel.x*=-1;
      vel.x*=x_loss;
      loc.x=(1);
    }

    if(loc.y&gt;height){
      vel.y*=-1;
      vel.y*=y_loss;
      vel.x*=x_loss; // also dampen the x movement a bit
      loc.y=height;

      // may as well only do this test when you are bouncing on the ground
      // remember that your velocities can be negative too!
      if(vel.y&lt;.9 &amp;&amp; vel.y&gt;-.9){
        if(vel.x&lt;.5 &amp;&amp; vel.x&gt;-.5){
          acc.x=0;
          vel.x=0;
          vel.y=0;
        }
      }
    }
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: adam</title>
		<link>http://www.jordanparsons.com/blog/2009/03/30/processing-glitchy-gravity/comment-page-1/#comment-21</link>
		<dc:creator>adam</dc:creator>
		<pubDate>Tue, 31 Mar 2009 06:05:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.jordanparsons.com/blog/?p=198#comment-21</guid>
		<description>Hey, found you on #processing.

Had a play with your code. Here are a few of the changes I made to simplify the changes in x velocity

set your x_loss to be between 0 and 1. eg. 0.90
this will set the x velocity to 90% of the old velocity

this dampening should mean that eventually you will match the condition to clamp the velocities and acceleration

&lt;pre class=&quot;brush: java&quot;&gt;
    if(loc.x&gt;width){
      vel.x*=-1; // change direction
      vel.x*=x_loss; // dampen the velocity
      loc.x=width; // set location to outside the collision area
    }
    if(loc.xheight){
      vel.y*=-1;
      vel.y*=y_loss;
      vel.x*=x_loss; // also dampen the x movement a bit
      loc.y=height;

      // may as well only do this test when you are bouncing on the ground
      // remember that your velocities can be negative too!
      if(vel.y-.9){
        if(vel.x-.5){
          acc.x=0;
          vel.x=0;
          vel.y=0;         
        }
      }
    }
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Hey, found you on #processing.</p>
<p>Had a play with your code. Here are a few of the changes I made to simplify the changes in x velocity</p>
<p>set your x_loss to be between 0 and 1. eg. 0.90<br />
this will set the x velocity to 90% of the old velocity</p>
<p>this dampening should mean that eventually you will match the condition to clamp the velocities and acceleration</p>
<pre class="brush: java">
    if(loc.x&gt;width){
      vel.x*=-1; // change direction
      vel.x*=x_loss; // dampen the velocity
      loc.x=width; // set location to outside the collision area
    }
    if(loc.xheight){
      vel.y*=-1;
      vel.y*=y_loss;
      vel.x*=x_loss; // also dampen the x movement a bit
      loc.y=height;

      // may as well only do this test when you are bouncing on the ground
      // remember that your velocities can be negative too!
      if(vel.y-.9){
        if(vel.x-.5){
          acc.x=0;
          vel.x=0;
          vel.y=0;
        }
      }
    }
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>
