<?xml version='1.0'?>
<?xml:stylesheet type="text/xsl" href="function.xsl" ?>
<function-list>
  <function>
    <name>UtilGetAngleBetween Property</name>
    <description>Computes the angle between two points. </description>
    <syntax>iValue = Game1.UtilGetAngleBetween(x1, y1, x2, y2)</syntax>
    <param-list>
      <param>
        <name>iValue</name>
	    <description>Integer. The angle between the points (x1,y1) and (x2,y2). </description>
      </param>
      <param>
        <name>x1</name>
	    <description>Integer. X coordinate of the first point. </description>
      </param>
      <param>
        <name>y1</name>
	    <description>Integer. Y coordinate of the first point. </description>
      </param>
      <param>
        <name>x2</name>
	    <description>Integer. X coordinate of the second point. </description>
      </param>
      <param>
        <name>y2</name>
	    <description>Integer. Y coordinate of the second point. </description>
      </param>
    </param-list>
	<remarks>This shouldn't be used for timing a game. Instead, use the TimerFired event and TimerStartTimer method.</remarks>
	<example>

Public Sub Game1_SpriteCollisionMouse(ByVal lSpriteNum As Long, ByVal x As Integer, ByVal y As Integer)
	...	

    Game1.SpriteGetPositionEx SPRITE_SOLDIER, 8, iSoldierX, iSoldierY
    m_iLastAngleSoldier = Game1.UtilGetAngleBetween(iSoldierX, iSoldierY, x, y)
    iDirection = Round(m_iLastAngleSoldier / 45) Mod 8
    Game1.SpriteSetFrameRange SPRITE_SOLDIER, iDirection * 9, iDirection * 9 + 7, True
    
    ...
End Sub
	</example>
  </function>
</function-list>
