<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.xna.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>General</title><link>http://forums.xna.com/forums/32.aspx</link><description>Don't know where to post your question? Post it here!</description><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 0.0)</generator><item><title>Re: AS - Artificial Stupidity. Enemy isnt responding correctly...</title><link>http://forums.xna.com/forums/thread/58095.aspx</link><pubDate>Sun, 20 Apr 2008 13:48:09 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:58095</guid><dc:creator>SomeRhino</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/58095.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=58095</wfw:commentRss><description>&amp;nbsp;One thing that may be causing problems is that you are doing a == test on two floats in the main if clause, and the chances of two floats being exactly equal is &lt;i&gt;quite&lt;/i&gt; improbable. I doubt this test would ever pass. Try using a range like &lt;div style="background-color:White;"&gt;&lt;div style="margin:0px;padding:2px 2px 2px 8px;background-color:White;overflow-x:scroll;overflow-y:hidden;width:505px;"&gt;&lt;pre&gt;&lt;span style="color:Black;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;if&lt;/span&gt; (Math.Abs(float1 &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;-&lt;/span&gt; float2) &amp;lt; 0.1f)&lt;br&gt;{ ... }&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;Please elaborate on what the AI does once it gets in range.&lt;br&gt;</description></item><item><title>AS - Artificial Stupidity. Enemy isnt responding correctly...</title><link>http://forums.xna.com/forums/thread/58087.aspx</link><pubDate>Sun, 20 Apr 2008 11:49:34 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:58087</guid><dc:creator>MatSav</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/58087.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=58087</wfw:commentRss><description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;My enemies are not exactly very responsive. It changes states and moves toward you along the z axis (all that is needed) but when it comes within range, it is meant to rotate to face the player and then shoot 2 shots one from either side of it. (its only a box till the model is finished). It doesnt do this. Here is the code from AI.cs. Please tell me if any more is needed...&lt;/P&gt;
&lt;DIV style="BACKGROUND-COLOR:white;"&gt;
&lt;TABLE style="BORDER-RIGHT:#e5e5e5 1px solid;BORDER-TOP:#e5e5e5 1px solid;BORDER-LEFT:#e5e5e5 1px solid;WIDTH:525px;BORDER-BOTTOM:#e5e5e5 1px solid;BACKGROUND-COLOR:white;" cellSpacing=0 cellPadding=0&gt;

&lt;TR style="VERTICAL-ALIGN:top;LINE-HEIGHT:normal;"&gt;
&lt;TD style="WIDTH:40px;TEXT-ALIGN:right;"&gt;&lt;PRE style="BORDER-RIGHT:#e7e7e7 1px solid;PADDING-RIGHT:2px;PADDING-LEFT:2px;FONT-SIZE:11px;PADDING-BOTTOM:2px;MARGIN:0px;COLOR:gray;PADDING-TOP:2px;FONT-FAMILY:courier new;"&gt;1&lt;BR&gt;2&lt;BR&gt;3&lt;BR&gt;4&lt;BR&gt;5&lt;BR&gt;6&lt;BR&gt;7&lt;BR&gt;8&lt;BR&gt;9&lt;BR&gt;10&lt;BR&gt;11&lt;BR&gt;12&lt;BR&gt;13&lt;BR&gt;14&lt;BR&gt;15&lt;BR&gt;16&lt;BR&gt;17&lt;BR&gt;18&lt;BR&gt;19&lt;BR&gt;20&lt;BR&gt;21&lt;BR&gt;22&lt;BR&gt;23&lt;BR&gt;24&lt;BR&gt;25&lt;BR&gt;26&lt;BR&gt;27&lt;BR&gt;28&lt;BR&gt;29&lt;BR&gt;30&lt;BR&gt;31&lt;BR&gt;32&lt;BR&gt;33&lt;BR&gt;34&lt;BR&gt;35&lt;BR&gt;36&lt;BR&gt;37&lt;BR&gt;38&lt;BR&gt;39&lt;BR&gt;40&lt;BR&gt;41&lt;BR&gt;42&lt;BR&gt;43&lt;BR&gt;44&lt;BR&gt;45&lt;BR&gt;46&lt;BR&gt;47&lt;BR&gt;48&lt;BR&gt;49&lt;BR&gt;50&lt;BR&gt;51&lt;BR&gt;52&lt;BR&gt;53&lt;BR&gt;54&lt;BR&gt;55&lt;BR&gt;56&lt;BR&gt;57&lt;BR&gt;58&lt;BR&gt;59&lt;BR&gt;60&lt;BR&gt;61&lt;BR&gt;62&lt;BR&gt;63&lt;BR&gt;64&lt;BR&gt;65&lt;BR&gt;66&lt;BR&gt;67&lt;BR&gt;68&lt;BR&gt; &lt;/PRE&gt;&lt;/TD&gt;
&lt;TD style="WIDTH:465px;"&gt;
&lt;DIV style="PADDING-RIGHT:2px;OVERFLOW-Y:hidden;PADDING-LEFT:8px;PADDING-BOTTOM:2px;MARGIN:0px;OVERFLOW:scroll;WIDTH:465px;PADDING-TOP:2px;"&gt;&lt;PRE&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:black;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;        &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;private&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;void&lt;/SPAN&gt; shootAtPlayer(Player player, Bullet[] enemyBullet, &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;int&lt;/SPAN&gt; difficulty)&lt;BR&gt;        {&lt;BR&gt;            rotation &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; turnToFaceO(toRotationVector2(position), toRotationVector2(player.position), rotation, 0.025f);&lt;BR&gt;            elevation &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; turnToFaceE(toElevationVector2(position), toElevationVector2(player.position), elevation, 0.025f);&lt;BR&gt;            &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;if&lt;/SPAN&gt; (!(rotation == playerOrientation &amp;amp;&amp;amp; elevation == playerElevation))&lt;BR&gt;            {&lt;BR&gt;                rotation &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; turnToFaceO(toRotationVector2(position), toRotationVector2(player.position), rotation, 0.025f);&lt;BR&gt;                elevation &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; turnToFaceE(toElevationVector2(position), toElevationVector2(player.position), elevation, 0.025f);&lt;BR&gt;            }&lt;BR&gt;            &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;else&lt;/SPAN&gt;&lt;BR&gt;            {&lt;BR&gt;                &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;for&lt;/SPAN&gt; (&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;int&lt;/SPAN&gt; i &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; 0; i &amp;lt; GameConstants.enemyClip; i++)&lt;BR&gt;                    &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;if&lt;/SPAN&gt; (!enemyBullet&lt;img src="http://forums.xna.com/emoticons/emotion-55.gif" alt="Idea" /&gt;.isActive)&lt;BR&gt;                    {&lt;BR&gt;                        Matrix orientationMatrix &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; Matrix.CreateRotationY(rotation);&lt;BR&gt;                        Matrix elevationMatrix &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; Matrix.CreateRotationX(elevation);&lt;BR&gt;                        Matrix trans &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; Matrix.CreateTranslation(player.position) &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;*&lt;/SPAN&gt; elevationMatrix &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;*&lt;/SPAN&gt; orientationMatrix;&lt;BR&gt;                        enemyBullet&lt;img src="http://forums.xna.com/emoticons/emotion-55.gif" alt="Idea" /&gt;.direction &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; trans.Translation;&lt;BR&gt;                        enemyBullet&lt;img src="http://forums.xna.com/emoticons/emotion-55.gif" alt="Idea" /&gt;.position &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; position &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;+&lt;/SPAN&gt; (trans.Right &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;*&lt;/SPAN&gt; 2f) &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;+&lt;/SPAN&gt; (trans.Forward &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;*&lt;/SPAN&gt; 2f);&lt;BR&gt;                        enemyBullet&lt;img src="http://forums.xna.com/emoticons/emotion-55.gif" alt="Idea" /&gt;.isActive &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;true&lt;/SPAN&gt;;&lt;BR&gt;                        &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;break&lt;/SPAN&gt;;&lt;BR&gt;                    }&lt;BR&gt;                &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;for&lt;/SPAN&gt; (&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;int&lt;/SPAN&gt; i &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; 0; i &amp;lt; GameConstants.enemyClip; i++)&lt;BR&gt;                    &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;if&lt;/SPAN&gt; (!enemyBullet&lt;img src="http://forums.xna.com/emoticons/emotion-55.gif" alt="Idea" /&gt;.isActive)&lt;BR&gt;                    {&lt;BR&gt;                        Matrix orientationMatrix &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; Matrix.CreateRotationY(rotation);&lt;BR&gt;                        Matrix elevationMatrix &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; Matrix.CreateRotationX(elevation);&lt;BR&gt;                        Matrix trans &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; Matrix.CreateTranslation(position) &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;*&lt;/SPAN&gt; elevationMatrix &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;*&lt;/SPAN&gt; orientationMatrix;&lt;BR&gt;                        enemyBullet&lt;img src="http://forums.xna.com/emoticons/emotion-55.gif" alt="Idea" /&gt;.direction &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; trans.Translation;&lt;BR&gt;                        enemyBullet&lt;img src="http://forums.xna.com/emoticons/emotion-55.gif" alt="Idea" /&gt;.position &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; position &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;+&lt;/SPAN&gt; (trans.Left &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;*&lt;/SPAN&gt; 2f) &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;+&lt;/SPAN&gt; (trans.Forward &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;*&lt;/SPAN&gt; 2f);&lt;BR&gt;                        enemyBullet&lt;img src="http://forums.xna.com/emoticons/emotion-55.gif" alt="Idea" /&gt;.isActive &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;true&lt;/SPAN&gt;;&lt;BR&gt;                        &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;break&lt;/SPAN&gt;;&lt;BR&gt;                    }&lt;BR&gt;                &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:green;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;//soundBank.PlayCue("EnemyShoot");&lt;/SPAN&gt;&lt;BR&gt;            }&lt;BR&gt;        }&lt;BR&gt;&lt;BR&gt;        &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;private&lt;/SPAN&gt; Vector2 toRotationVector2(Vector3 v) { &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;return&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;new&lt;/SPAN&gt; Vector2(v.X, v.Z); }&lt;BR&gt;        &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;private&lt;/SPAN&gt; Vector2 toElevationVector2(Vector3 v) { &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;return&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;new&lt;/SPAN&gt; Vector2((&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt;)Math.Sqrt(Math.Pow(v.X, 2) &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;+&lt;/SPAN&gt; Math.Pow(v.Z, 2)), v.Y); }&lt;BR&gt;&lt;BR&gt;        &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;private&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt; turnToFaceO(Vector2 position, Vector2 faceThis, &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt; currentAngle, &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt; turnSpeed)&lt;BR&gt;        {&lt;BR&gt;            &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt; x &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; faceThis.X &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;-&lt;/SPAN&gt; position.X;&lt;BR&gt;            &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt; y &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; faceThis.Y &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;-&lt;/SPAN&gt; position.Y;&lt;BR&gt;            playerOrientation &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; (&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt;)Math.Atan2(y, x);&lt;BR&gt;            &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt; difference &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; wrapAngle(playerOrientation &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;-&lt;/SPAN&gt; currentAngle);&lt;BR&gt;            difference &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; MathHelper.Clamp(difference, -turnSpeed, turnSpeed);&lt;BR&gt;            &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;return&lt;/SPAN&gt; wrapAngle(currentAngle &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;+&lt;/SPAN&gt; difference);&lt;BR&gt;        }&lt;BR&gt;&lt;BR&gt;        &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;private&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt; turnToFaceE(Vector2 position, Vector2 faceThis, &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt; currentAngle, &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt; turnSpeed)&lt;BR&gt;        {&lt;BR&gt;            &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt; x &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; faceThis.X &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;-&lt;/SPAN&gt; position.X;&lt;BR&gt;            &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt; y &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; faceThis.Y &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;-&lt;/SPAN&gt; position.Y;&lt;BR&gt;            playerElevation &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; (&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt;)Math.Atan2(y, x);&lt;BR&gt;            &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt; difference &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; wrapAngle(playerElevation &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;-&lt;/SPAN&gt; currentAngle);&lt;BR&gt;            difference &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; MathHelper.Clamp(difference, -turnSpeed, turnSpeed);&lt;BR&gt;            &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;return&lt;/SPAN&gt; wrapAngle(currentAngle &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;+&lt;/SPAN&gt; difference);&lt;BR&gt;        }&lt;BR&gt;&lt;BR&gt;        &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;private&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt; wrapAngle(&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt; radians)&lt;BR&gt;        {&lt;BR&gt;            &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;while&lt;/SPAN&gt; (radians &amp;lt; -MathHelper.Pi)&lt;BR&gt;                radians += MathHelper.TwoPi;&lt;BR&gt;            &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;while&lt;/SPAN&gt; (radians &amp;gt; MathHelper.Pi)&lt;BR&gt;                radians -= MathHelper.TwoPi;&lt;BR&gt;            &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;return&lt;/SPAN&gt; radians;&lt;BR&gt;        }&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;&lt;/DIV&gt;</description></item></channel></rss>