<html>
<head>
<title>DarkBASIC Professional Help File</title>
</head>
<body background="..\..\gfx\dbpro_bg.jpg">
<!-- Page Header -->
<center><table width="340" border="0" cellpadding="0" cellspacing="0">
<tr>
	<td><img src="..\..\gfx\dbph_head_1.jpg" width="102" height="51"></td>
	<td><a href="..\..\main.htm"><img src="..\..\gfx\dbph_head_2.jpg" width="47" height="51" border="0"></a></td>
	<td><a href="..\..\commands.htm"><img src="..\..\gfx\dbph_head_3.jpg" width="50" height="51" border="0"></a></td>
	<td><a href="..\..\examples.htm"><img src="..\..\gfx\dbph_head_4.jpg" width="47" height="51" border="0"></a></td>
	<td><a href="..\..\documents.htm"><img src="..\..\gfx\dbph_head_5.jpg" width="46" height="51" border="0"></a></td>
	<td><a href="..\..\index.htm"><img src="..\..\gfx\dbph_head_6.jpg" width="56" height="51" border="0"></a></td>
</tr>
</table></center>
<font face="Verdana">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td>
<!-- Function Head -->
<font face="Verdana" size="5">
<b>
SPRITE COLLISION
</b>
<font face="Verdana" size="2">
<p>
This command will return a one if the specified sprite is overlapping the target sprite specified. 
</p>
</font>
<!-- Synopsis -->
<table width="590" cellpadding="3">
<tr><td bgcolor="#0d4283"><font color="#ffffff" size="3"><b>&nbsp;
Syntax
</b></font></td></tr>
</table>
<font face="Verdana" size="2">
<pre>
Return Integer=SPRITE COLLISION(Sprite Number, Target Sprite Number)
</pre>
</font>
<!-- Parameters -->
<table width="590" cellpadding="3">
<tr><td bgcolor="#0d4283"><font color="#ffffff" size="3"><b>&nbsp;
Parameters
</b></font></td></tr>
</table>
<font face="Verdana" size="2">
<pre>
Sprite Number
</pre>
<blockquote>
Integer
<br>
The sprite number
</blockquote>
<pre>
Target Sprite Number
</pre>
<blockquote>
Integer
<br>
The target sprite number, and if a target sprite has not been specified and a value of zero has been used, this command will return the sprite number of any sprite overlapping it
</blockquote>
</font>
<BR>
<!-- Returns -->
<table width="590" cellpadding="3">
<tr><td bgcolor="#0d4283"><font color="#ffffff" size="3"><b>&nbsp;
Returns
</b></font></td></tr>
</table>
<font face="Verdana" size="2">
<p>
This value is an integer number such as 1.
</p>
</font>
<!-- Description -->
<table width="590" cellpadding="3">
<tr><td bgcolor="#0d4283"><font color="#ffffff" size="3"><b>&nbsp;
Description
</b></font></td></tr>
</table>
<font face="Verdana" size="2">
<p>
If a target sprite has not been specified and a value of zero has been used, this command will return the sprite number of any sprite overlapping it. The parameters should be specified using integer values.
</p>
</font>
<!-- Examples -->
<table width="590" cellpadding="3">
<tr><td bgcolor="#0d4283"><font color="#ffffff" size="3"><b>&nbsp;
Example Code
</b></font></td></tr>
</table>
<font face="Verdana" size="2">
<pre>
cls<BR>
load image "man.bmp",1<BR>
sprite 1,100,100,1<BR>
sprite 2,100,110,1<BR>
wait 1000*8<BR>
do<BR>
paste sprite 1,mousex(),mousey()<BR>
num=sprite collision(1,0)<BR>
if num>0<BR>
cls<BR>
cls<BR>
print "we have it sprite number "+str$(num)cls<BR>
endif<BR>
cls<BR>
loop<BR>
end<BR>
</pre>
</font>
<!-- See Also -->
<table width="590" cellpadding="3">
<tr><td bgcolor="#0d4283"><font color="#ffffff" size="3"><b>&nbsp;
See also
</b></font></td></tr>
</table>
<font face="Verdana" size="2">
<p>
<a href="..\sprite.htm">SPRITE Commands Menu<BR>
</a>
<a href="..\..\index.htm">Index</a><BR>
</p>
</font>
<BR>
<!-- Function Footer -->
</font>
</td></tr></table>
<br>
<!-- Page Footer -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
	<td align="center"><img src="..\..\gfx\dbph_foot_1.jpg" width="340" height="38"></td>
</tr>
</table>
</body>
</html>
