im having a little problem and cant think of a solution or if this is even the best way to go about doing this. thez game map loads and you can use north east south west to move, i added a little code to get an image to load for the player and now i added some code for the towns to be seen but they are not appearing in the correct place
function view_base($id){
$user=getUserInfo($_SESSION['USERID']);
$q="SELECT * FROM `user_bases` WHERE `PLANET` = 1";
$v=mysql_query($q);
while($info=mysql_fetch_array($v)){
$locDotX = $user["X"] - $info["X"] + 200;
$locDotY = $user["Y"] - $info["Y"] + 200;
echo "<div style='position:relative; top:{$locDotY}; left:{$locDotX}; z-index:auto;'><img src='images/dot.gif' width='7' height='7'></div></td>";
}
}
<td width="243" rowspan="3">
<?
$x = $user["X"] -46;
$y = $user["Y"] -46;
?>
<table width=400 height=400 style="background-image:url('images/map.gif'); background-position: <?echo "{$x}px"?> <?echo "{$y}px"?>; background-repeat: repeat; border-width: 1px; border-spacing: ; border-style: outset; border-color: black; border-collapse: collapse;">
<td>
<? view_base(1);
echo "<div style='position:relative; top:211; left:204; color:red; font-size: 50px; z-index:auto;'><img src='images/dot.gif' width='7' height='7'></div></td>";
?>
sorry the code isnt perfect i am still learning, the only 1 that is in the correct position is at 0,0 coords the rest just seem a little random, i cant think of why and have tried a few solutions but with no luck. the coords will enentually go into negatives but for the moment i am just thinking about positive numbers untill i get the basics working. i dont know if it is to do with the way i am loading the images or if its my code,any help would be great. thanks, oh and sorry if my typing is a little off i am using a french keyboard and the keys are in differant positions.
Mark