Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $xs=0;
- $ys=0;
- for(i=0;i<50;i=i+1)
- for(j=0;j<50;j=j+1)
- {
- $tile[i,j]=0;
- }
- $sql="SELECT * FROM villages WHERE x>=$xs and y>=$ys and x<$xs+50 and y<$ys+50";
- $result=mysql_query($sql);
- while($row=mysql_fetch_array($result))
- {
- $tile[$row["x"]-$xs,$row["y"]-$ys]=$row["id"];
- }
- echo "<table>";
- for(i=0;i<50;i=i+1)
- {
- echo "<tr>";
- for(j=0;j<50;j=j+1)
- {
- if ($tile[i,j]==0)
- {
- echo "<td>grass.png</td>";
- }
- else
- {
- echo "<td>village.png</td>";
- }
- }
- echo "</tr>";
- }
- echo "</table>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement