http://www.eryamanreklam.com/

Php de oyun yazma

Basit bir tıklandığında hücrelerden kaçan basit bir oyundur..

<!--?php 
session_start();
$icon1="&lt;img src='runner1.jpg' width='30px'&gt; ";
$icon2="&lt;img src='runner2.jpg' width='30px'";
echo '&lt;/p&gt;
&lt;table border="1"&gt;';
 
if(isset($_SESSION['res1']))
	$res1 = $_SESSION['res1'];
else
	$res1=5;
if(isset($_SESSION['res2']))
	$res2 = $_SESSION['res2'];
else
	$res2=1;
 
 
if(isset($_GET['sira']))
{
    if($_GET['sira']==3)
    {
        $res1 =5;
        $res2=1;
        $_SESSION['res1']=$res1;
        $_SESSION['res2']=$res2;
    }
   if($_GET['sira']==1)
    {
        $res1 +=rand(1,4);
        $_SESSION['res1']=$res1;
    }
    else if($_GET['sira']==2) 
    {
        $res2 +=rand(1,3);
        $_SESSION['res2']=$res2;
    }
 
}
 
 
for($i=1; $i&lt;3; $i++)
{
    echo " &lt;/p&gt;
&lt;tr&gt;";
       for($y=1; $y&lt;20; $y++)
       {
           if($i==1 &amp;&amp; $y==$res1)
             echo "&lt;/p&gt;
&lt;td width='30px'&gt; &lt;a href='?sira=1'&gt; $icon1&lt;/a&gt;&lt;/td&gt;
&lt;p&gt;";
             else if ($i==2 &amp;&amp; $y==$res2)
             echo "&lt;/p&gt;
&lt;td width='30px'&gt;&lt;a href='?sira=2'&gt; $icon2&lt;/a&gt;&lt;/td&gt;
&lt;p&gt;";
             else echo "&lt;/p&gt;
&lt;td width='30px'&gt; &lt;/td&gt;
&lt;p&gt;";
       }
    echo " &lt;/tr&gt;
&lt;p&gt;";
}
echo '&lt;/table&gt;
&lt;p&gt;'; 
echo  "&lt;a href='?sira=3'&gt; sifirla&lt;/a&gt;";
?-->