<?xml version='1.0'?>
<?xml:stylesheet type="text/xsl" href="function.xsl" ?>
<function-list>
  <function>
    <name>SpriteCollisionMouse Event</name>
    <description>This event is fired when the stylus taps on a sprite.</description>
    <syntax>Game1_SpriteCollisionMouse(ByVal lSpriteNum As Long, ByVal x As Integer, ByVal y As Integer, ByVal bOnMouseMove As Boolean)</syntax>
    <param-list>
      <param>
        <name>lSpriteNum</name>
	    <description>Long. Unique sprite ID of the sprite involved in the collision.</description>
      </param>
      <param>
        <name>x</name>
	    <description>Integer. X Coordinate of the stylus when the collision occurred.</description>
      </param>
      <param>
        <name>y</name>
	    <description>Integer. Y Coordinate of the stylus when the collision occurred.</description>
      </param>
      <param>
        <name>bOnMouseMove</name>
	    <description>Boolean. If True, then this event occurred because (a) the mouse moved over the sprite; or (b) the sprite moved into the mouse x,y coordinates. If False, then this event occurred because the mouse was clicked down directly on the sprite.</description>
      </param>
    </param-list>
	<remarks>To diminish the rectangle that triggers collision events, use the SpriteDiminishCollisionRect method.</remarks>
	<example>
Public Sub Game1_SpriteCollisionMouse(ByVal lSpriteNum As Long, ByVal x As Integer, ByVal y As Integer, ByVal bOnMouseMove As Boolean)
    If (lSpriteNum >= m_iFirstBug And lSpriteNum &lt;= m_iFirstBug + MAX_BUGS - 1) And _
        Game1.SpriteFrame(lSpriteNum) &lt; 64 Then
        Dim iDirection As Integer, iSoldierX As Integer, iSoldierY As Integer
        m_bFiring = True
        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 If
End Sub
	</example>
  </function>
</function-list>

