Créer son jeu en PHP

Tout pour créer soit-même son jeu en PHP
 
AccueilAccueil  ­CalendrierCalendrier  ­FAQFAQ  ­RechercherRechercher  ­S'enregistrerS'enregistrer  ­MembresMembres  ­GroupesGroupes  ­ConnexionConnexion  
Poster un nouveau sujet   Répondre au sujetPartager | 
 

 Probleme sur la Map

Voir le sujet précédent Voir le sujet suivant Aller en bas 
AuteurMessage
Guilma
Nouveau


Nombre de messages: 5
Age: 20
Date d'inscription: 25/07/2006

MessageSujet: Probleme sur la Map   Mar 8 Aoû - 18:47

[quote]<?php
session_start();


mysql_connect('localhost', 'root', '');
mysql_select_db('jeu');

$req1 = mysql_query("SELECT * FROM membre WHERE login = '".$_SESSION['login']."'");
$data1 = mysql_fetch_array($req1);
?>

<?
$vision = $data1['vision'];

$x = $data1['x']; //récupération de l'abscisse du perso
$y = $data1['y']; //récupération de l'ordonnée du perso
$compteurX = $x - $vision; //champ de vision
$compteurY = $y - $vision; //champ de vision
$finX = $x + $vision; //champ de vision
$finY = $y + $vision; //champ de vision
$debutX = $x - $vision;

echo '<table cellspacing="0" cellpadding="0">';

//----------------- UNE LIGNE -----------------\\
while($compteurY <= $finY)
{
echo "<tr>";
//----------------- UNE CASE -----------------\\
while($compteurX <= $finX)
{
$req2 = mysql_query("SELECT terrain FROM batiments WHERE x='".$compteurX."' AND y='".$compteurY."'");
if(mysql_num_rows($req2) == 1) //s'il y a un bâtiment, on sélectionne la couleur de son terrain
{
$data2 = mysql_fetch_array($req2);
if($mois == 12 OR $mois == 01 OR $mois == 02) //si on est en hiver
{
switch($data2['terrain'])
{
case "4425544":
$rgb = "127255127";
break;
case "178178178":
$rgb = "188188188";
break;
case "132193136":
$rgb = "182218185";
break;
case "01060":
$rgb = "4920449";
break;
case "1060106":
$rgb = "19896253";
break;
case "962626":
$rgb = "19210101";
break;
default:
$rgb = $data2['terrain'];
}
}
else
{
$rgb = $data2['terrain'];
}
}
else //sinon on sélectionne la couleur du terrain via le pixel correspondant
{



$image = ImageCreateFromPng("Europe_1205_ete.png");

$rgb = ImageColorAt($image, $compteurX, $compteurY); //on identifie la couleur du pixel donné à partir de ses coordonnées <--- LIGNE 74
$r = ($rgb >> 16) & 0xFF;
$g = ($rgb >> 8) & 0xFF;
$b = $rgb & 0xFF;
$rgb = $r.$g.$b; //couleur RGB du pixel
}
$col = array(
"4425544" => "herbe.gif", "127255127" => "herbe.gif", "138138138" => "herbe.gif", "178178178" => "herbe.gif",
"188188188" => "herbe.gif", "132193136" => "contrees.gif", "182218185" => "herbe.gif", "25500" => "hebre.gif",
"0231231" => "herbe.gif", "44113255" => "herbe.gif", "1361360" => "herbe.gif", "01060" => "herbe.gif",
"4920449" => "herbe.gif", "1060106" => "herbe.gif", "19896253" => "herbe.gif",
"962626" => "herbe.gif", "192101101" => "herbe.gif", "255255255" => "herbe.gif",
"000" => "herbe.gif", "12812864" => "herbe.gif", "255255128" => "herbe.gif", "0168168" => "herbe.gif",
"229229229" => "herbe.gif");
?>
<td onMouseout='infoterrain("rien")' onMouseover='infoterrain("<? echo $rgb; ?>")' valign='center' style='text-align:center;width:60px;height:60px;background-color:RGB("<? echo $r; ?>","<? echo $g; ?>","<? echo $b; ?>");background-image:url("<? echo $col[$rgb]; ?>");width:60px;height:60px'>
<?
$req3 = mysql_query("SELECT * FROM membre WHERE x='".$compteurX."' AND y='".$compteurY."'");

if(mysql_num_rows($req3) == 1) //s'il y a un personnage
{
$data3 = mysql_fetch_array($req3);
$req3bis = mysql_query("SELECT * FROM membre WHERE login='".$data3['login']."'");
$data3bis = mysql_fetch_array($req3bis);
if($compteurX == $x AND $compteurY == $y)
{
?>
<div style="width:60px;height:60px;overflow:hidden">
<div style="
text-align: left;
font-size: 12px;
font-family: Arial, 'Times New Roman';
width: 300px;
height: 200px;
border-top: 1px solid white;
border-left: 1px solid white;
border-right: 1px solid black;
border-bottom: 1px solid black;
left: 387px;
top: 436px;
z-index: 1;
background-image: url('');
visibility: hidden;
position: absolute;
overflow: auto;
padding:4px" id="<? echo $data3['id']; ?>">
<p style="font-size:14px;color:white;font-weight:bold"><? echo $data3['login']; ?></p>
<p style="color:white" class="donnees">Rang : <? echo $data3bis['grade']; ?><br />
Pays : <? echo $data3bis['Royaume']; ?><br />
Fief : <? echo $data3bis['Race']; ?></p>
<p style="text-align:center"><input type="submit" class="submit" value="Accéder au profil"></p>
<p style="color:white"><a style="color:white;cursor:pointer" onClick="MM_showHideLayers('<? echo $data3['id']; ?>','','hide')">Fermer l'onglet</a></p>
</div>
<img width="60" height="60" alt="Vous-même" title="Vous-même" src="<? echo $data3['skin']; ?>" style="cursor:default" border="0" onclick="MM_showHideLayers('<? echo $data3['id']; ?>','','show')"></div>
<? } //vous-même
elseif($compteurX == $data3['x'] AND $compteurY == $data3['y'])
{
?>
<div style="width:60px;height:60px;overflow:hidden">
<div style="
text-align: left;
font-size: 12px;
font-family: Arial, 'Times New Roman';
width: 300px;
height: 200px;
border-top: 1px solid white;
border-left: 1px solid white;
border-right: 1px solid black;
border-bottom: 1px solid black;
left: 387px;
top: 436px;
z-index: 1;
background-image: url('');
visibility: hidden;
position: absolute;
overflow: auto;
padding:4px" id="<? echo $data3['id']; ?>">
<p style="font-size:14px;color:white;font-weight:bold"><? echo $data3['login']; ?></p>
<p style="color:white" class="donnees">Rang : <? echo $data3bis['grade']; ?><br />
Pays : <? echo $data3bis['Royaume']; ?><br />
Fief : <? echo $data3bis['race']; ?></p>
<p style="text-align:center"><input type="submit" class="submit" value="Accéder au profil"></p>
<p style="color:white"><a style="color:white;cursor:pointer" onClick="MM_showHideLayers('<? echo $data3['id']; ?>','','hide')">Fermer l'onglet</a></p>
</div>
<img width="60" height="60" alt="<? echo $data3['login']; ?>" title="<? echo $data3['login']; ?>" src="<? echo $data3['skin']; ?>" style="cursor:default" border="0" onclick="MM_showHideLayers('<? echo $data3['id']; ?>','','show')"></div>
<?
} //les autres personnages
}
else //s'il n'y a pas de personnage
{
$req4 = mysql_query("SELECT * FROM batiments WHERE x='".$compteurX."' AND y='".$compteurY."'");
if(mysql_num_rows($req4) == 1)//s'il y a un bâtiment
{
$data4 = mysql_fetch_array($req4);
?>
<div title="<? echo $data4['batiment']; ?>" style="width:60px;height:60px;background-image:url('<? echo $data4['skin']; ?>')" onclick="MM_showHideLayers('<? echo $data4['id']; ?>','','show')">
<div style="
text-align: left;
font-size: 12px;
font-family: Arial, 'Times New Roman';
width: 300px;
height: 200px;
border-top: 1px solid white;
border-left: 1px solid white;
border-right: 1px solid black;
border-bottom: 1px solid black;
left: 387px;
top: 436px;
z-index: 1;
background-image: url('');
visibility: hidden;
position: absolute;
overflow: auto;
padding:4px" id="<? echo $data4['id']; ?>">
<p style="font-size:14px;color:white;font-weight:bold"><? echo $data4['batiment']; ?></p>
<p style="color:white;font-size:11px"><? echo $data4['description']; ?></p>
<p style="color:white"><a style="color:white;cursor:pointer" onClick="MM_showHideLayers('<? echo $data4['id']; ?>','','hide')">Fermer l'onglet</a></p>
</div>
<?
$reqmag = mysql_query("SELECT * FROM magasin WHERE batiment='".$data4['skin']."'");
if(mysql_num_rows($reqmag) == 1)
{
$mag = mysql_fetch_array($reqmag);
?><img src="<? echo $mag['enseigne']; ?>">
<?
}
echo'</div>';
}
else //s'il n'y a ni personnage, ni bâtiment
{
$req5 = mysql_query("SELECT * FROM monstres WHERE x='".$compteurX."' AND y='".$compteurY."'");
if(mysql_num_rows($req5) == 1) //s'il y a un monstre
{
$data5 = mysql_fetch_array($req5);
echo '<img src="'.$data5['skin'].'" alt="'.$data5['skin'].'" title="'.$data5['skin'].'" style="cursor:help" width="60" height="60">';
}
else //s'il n'y a ni personnage, ni monstre, ni bâtiment
{
$x1 = $x + 1;
$y1 = $y + 1;
$x_1 = $x - 1;
$y_1 = $y - 1;
if($rgb == "0231231" OR $rgb == "1361360" OR $rgb == "44113255" OR $rgb == "000"){ echo '<div align="center" style="width:60px;height:60px">&nbsp;</div>';} //terrains inacessibles
else //si c'est un terrain accessible
{
Revenir en haut Aller en bas
Voir le profil de l'utilisateur
Guilma
Nouveau


Nombre de messages: 5
Age: 20
Date d'inscription: 25/07/2006

MessageSujet: Re: Probleme sur la Map   Mar 8 Aoû - 18:47

if($compteurX == $x + 1 AND $compteurY == $y){echo '<div style="width:60px;height:60px;overflow:hidden"><form action="deplacement.php" method="post"><input type="hidden" name="deplacement" value="est"><input alt="Est" title="Est" type="image" src="epee_droite.gif"></form></div>';}
elseif($compteurX == $x - 1 AND $compteurY == $y){echo '<div style="width:60px;height:60px;overflow:hidden"><form action="deplacement.php" method="post"><input type="hidden" name="deplacement" value="ouest"><input alt="Ouest" title="Ouest" type="image" src="epee_gauche.gif"></form></div>';}
elseif($compteurX == $x AND $compteurY == $y + 1){echo '<div style="width:60px;height:60px;overflow:hidden"><form action="deplacement.php" method="post"><input type="hidden" name="deplacement" value="sud"><input alt="Sud" title="Sud" type="image" src="epee_bas.gif"></form></div>';}
elseif($compteurX == $x AND $compteurY == $y - 1){echo '<div style="width:60px;height:60px;overflow:hidden"><form action="deplacement.php" method="post"><input type="hidden" name="deplacement" value="nord"><input alt="Nord" title="Nord" type="image" src="epee_haut.gif"></form></div>';}
elseif($compteurX == $x + 1 AND $compteurY == $y + 1){echo '<div style="width:60px;height:60px;overflow:hidden"><form action="deplacement.php" method="post"><input type="hidden" name="deplacement" value="sudest"><input alt="Sud-Est" title="Sud-Est" type="image" src="epee_basdroite.gif"></form></div>';}
elseif($compteurX == $x + 1 AND $compteurY == $y - 1){echo '<div style="width:60px;height:60px;overflow:hidden"><form action="deplacement.php" method="post"><input type="hidden" name="deplacement" value="nordest"><input alt="Nord-Est" title="Nord-Est" type="image" src="epee_hautdroite.gif"></form></div>';}
elseif($compteurX == $x - 1 AND $compteurY == $y + 1){echo '<div style="width:60px;height:60px;overflow:hidden"><form action="deplacement.php" method="post"><input type="hidden" name="deplacement" value="sudouest"><input alt="Sud-Ouest" title="Sud-Ouest" type="image" src="epee_basgauche.gif"></form></div>';}
elseif($compteurX == $x - 1 AND $compteurY == $y - 1){echo '<div style="width:60px;height:60px;overflow:hidden"><form action="deplacement.php" method="post"><input type="hidden" name="deplacement" value="nordouest"><input alt="Nord-Ouest" title="Nord-Ouest" type="image" src="epee_hautgauche.gif"></form></div>';}
elseif($compteurX == $x + 2 AND $compteurY == $y)
{
$dep = mysql_query("SELECT * FROM membre WHERE x='".$x1."' AND y='".$y."'");
if(mysql_num_rows($dep) == 1)
{
echo '<div style="width:60px;height:60px;overflow:hidden"><form action="deplacement.php" method="post"><input type="hidden" name="deplacement" value="est2"><input alt="Est" title="Est" type="image" src="epee_droite.gif"></form></div>';
}
else
{echo '<div align="center" style="width:60px;height:60px">&nbsp;</div>';}
}
elseif($compteurX == $x - 2 AND $compteurY == $y)
{
$dep = mysql_query("SELECT * FROM membre WHERE x='".$x_1."' AND y='".$y."'");
if(mysql_num_rows($dep) == 1)
{
echo '<div style="width:60px;height:60px;overflow:hidden"><form action="deplacement.php" method="post"><input type="hidden" name="deplacement" value="ouest2"><input alt="Ouest" title="Ouest" type="image" src="epee_gauche.gif"></form></div>';
}
else
{echo '<div align="center" style="width:60px;height:60px">&nbsp;</div>';}
}
elseif($compteurX == $x AND $compteurY == $y + 2)
{
$dep = mysql_query("SELECT * FROM membre WHERE x='".$x."' AND y='".$y1."'");
if(mysql_num_rows($dep) == 1)
{
echo '<div style="width:60px;height:60px;overflow:hidden"><form action="deplacement.php" method="post"><input type="hidden" name="deplacement" value="sud2"><input alt="Sud" title="Sud" type="image" src="epee_bas.gif"></form></div>';
}
else
{echo '<div align="center" style="width:60px;height:60px">&nbsp;</div>';}
}
elseif($compteurX == $x AND $compteurY == $y - 2)
{
$dep = mysql_query("SELECT * FROM membre WHERE x='".$x."' AND y='".$y_1."'");
if(mysql_num_rows($dep) == 1)
{
echo '<div style="width:60px;height:60px;overflow:hidden"><form action="deplacement.php" method="post"><input type="hidden" name="deplacement" value="nord2"><input alt="Nord" title="Nord" type="image" src="epee_haut.gif"></form></div>';
}
else
{echo '<div align="center" style="width:60px;height:60px">&nbsp;</div>';}
}
elseif($compteurX == $x + 2 AND $compteurY == $y + 2)
{
$dep = mysql_query("SELECT * FROM membre WHERE x='".$x1."' AND y='".$y1."'");
if(mysql_num_rows($dep) == 1)
{
echo '<div style="width:60px;height:60px;overflow:hidden"><form action="deplacement.php" method="post"><input type="hidden" name="deplacement" value="sudest2"><input alt="Sud-Est" title="Sud-Est" type="image" src="epee_basdroite.gif"></form></div>';
}
else
{echo '<div align="center" style="width:60px;height:60px">&nbsp;</div>';}
}
elseif($compteurX == $x + 2 AND $compteurY == $y - 2)
{
$dep = mysql_query("SELECT * FROM membre WHERE x='".$x1."' AND y='".$y_1."'");
if(mysql_num_rows($dep) == 1)
{
echo '<div style="width:60px;height:60px;overflow:hidden"><form action="deplacement.php" method="post"><input type="hidden" name="deplacement" value="nordest2"><input alt="Nord-Est" title="Nord-Est" type="image" src="epee_hautdroite.gif"></form></div>';
}
else
{echo '<div align="center" style="width:60px;height:60px">&nbsp;</div>';}
}
elseif($compteurX == $x - 2 AND $compteurY == $y + 2)
{
$dep = mysql_query("SELECT * FROM membre WHERE x='".$x_1."' AND y='".$y1."'");
if(mysql_num_rows($dep) == 1)
{
echo '<div style="width:60px;height:60px;overflow:hidden"><form action="deplacement.php" method="post"><input type="hidden" name="deplacement" value="sudouest2"><input alt="Sud-Ouest" title="Sud-Ouest" type="image" src="epee_basgauche.gif"></form></div>';
}
else
{echo '<div align="center" style="width:60px;height:60px">&nbsp;</div>';}
}
elseif($compteurX == $x - 2 AND $compteurY == $y - 2)
{
$dep = mysql_query("SELECT * FROM membre WHERE x='".$x_1."' AND y='".$y_1."'");
if(mysql_num_rows($dep) == 1)
{
echo '<div style="width:60px;height:60px;overflow:hidden"><form action="deplacement.php" method="post"><input type="hidden" name="deplacement" value="nordouest2"><input alt="Nord-Ouest" title="Nord-Ouest" type="image" src="epee_hautgauche.gif"></form></div>';
}
else
{echo '<div align="center" style="width:60px;height:60px">&nbsp;</div>';}
}
else{echo '<div align="center" style="width:60px;height:60px">&nbsp;</div>';}
}
}
}
}
echo "</td>";
$compteurX++;
} //fin de la boucle "case"
echo "</tr>";
$compteurX = $debutX;
$compteurY++;
} //fin de la boucle "colonne"
echo '</table></div>';


mysql_close();
?>
</div>[/quote]

Voici mon code pour l'affichage de ma map.

Le seul probleme c'est que lorsque j'execute mon script.

J'obtiens ceci avant l'affichage de la map:

Citation:

Notice: imagecolorat(): -3,-3 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -2,-3 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -1,-3 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): 0,-3 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): 1,-3 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): 2,-3 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): 3,-3 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): 4,-3 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): 5,-3 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): 6,-3 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): 7,-3 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -3,-2 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -2,-2 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -1,-2 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): 0,-2 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): 1,-2 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): 2,-2 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): 3,-2 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): 4,-2 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): 5,-2 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): 6,-2 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): 7,-2 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -3,-1 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -2,-1 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -1,-1 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): 0,-1 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): 1,-1 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): 2,-1 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): 3,-1 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): 4,-1 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): 5,-1 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): 6,-1 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): 7,-1 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -3,0 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -2,0 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -1,0 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -3,1 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -2,1 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -1,1 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -3,2 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -2,2 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -1,2 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -3,3 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -2,3 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -1,3 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -3,4 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -2,4 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -1,4 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: Undefined variable: mois in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 36

Notice: Undefined variable: mois in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 36

Notice: Undefined variable: mois in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 36

Notice: imagecolorat(): -3,5 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -2,5 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -1,5 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -3,6 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -2,6 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -1,6 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -3,7 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -2,7 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74

Notice: imagecolorat(): -1,7 is out of bounds in c:\program files\easyphp1-8\www\jeu\map\jouer4.php on line 74



Je n'ai aucune idée du probleme là. En plus la fenetre ne s'affiche pas lorsqu'on clic sur un perso et les fleches de deplacement ne s'affichent pas non plus.
Revenir en haut Aller en bas
Voir le profil de l'utilisateur
transgohan
Langue pendue


Nombre de messages: 68
Date d'inscription: 10/06/2006

MessageSujet: Re: Probleme sur la Map   Mar 8 Aoû - 19:12

Cette fonction accepte-t-elle les chiffres négatifs ?
Car à première vu ce ne sont que les cases ayant une coordonnée négative.

_________________
Auberpg: mon jdr en construction
Version beta ouverte: necessite RP !
Revenir en haut Aller en bas
Voir le profil de l'utilisateur
Guilma
Nouveau


Nombre de messages: 5
Age: 20
Date d'inscription: 25/07/2006

MessageSujet: Re: Probleme sur la Map   Mar 8 Aoû - 19:17

Le probleme c'est que cette fonction marche trés bien sur le code d'un pote.
Revenir en haut Aller en bas
Voir le profil de l'utilisateur
transgohan
Langue pendue


Nombre de messages: 68
Date d'inscription: 10/06/2006

MessageSujet: Re: Probleme sur la Map   Mar 8 Aoû - 20:31

Out of bounds veut dire hors des limites donc je ne pense pas qu'elle accepte les négatifs. Vérifies sur un site répertoriant les fonction php.

_________________
Auberpg: mon jdr en construction
Version beta ouverte: necessite RP !
Revenir en haut Aller en bas
Voir le profil de l'utilisateur
------------------
Bavard


Nombre de messages: 49
Age: 27
Localisation: Paris
Date d'inscription: 24/07/2006

MessageSujet: Re: Probleme sur la Map   Mar 8 Aoû - 21:34

Tu pourrais nous donner la définition de la fonction ImageColorAt($image, $compteurX, $compteurY) ?

merci

_________________
Revenir en haut Aller en bas
Voir le profil de l'utilisateur
carlou
Modérateur JeuPHP


Nombre de messages: 689
Localisation: Bordeaux
Date d'inscription: 27/08/2005

MessageSujet: Re: Probleme sur la Map   Mer 9 Aoû - 0:49

Citation:
imagecolorat

(PHP 3, PHP 4, PHP 5)
imagecolorat -- Retourne l'index de la couleur d'un pixel donné
Description
int imagecolorat ( resource image, int x, int y )

imagecolorat() retourne l'index de la couleur du pixel situé aux coordonnées (x, y), dans l'image image.

Si PHP supporte la bibliothèque GD version 2.0 ou plus récent, et que l'image est une image en TrueColor, cette fonction retourne la valeur RGB du pixel, sous forme d'un entier. Utiliser les opérateurs de bits et les masques pour distinguer le rouge, du vert et du bleu :

Exemple 1. Accès aux valeurs RGB
<?php
$im = ImageCreateFromPng("rockym.png");
$rgb = ImageColorAt($im, 100, 100);
$r = ($rgb >> 16) & 0xFF;
$g = ($rgb >> 8) & 0xFF;
$b = $rgb & 0xFF;
?>

Voir aussi imagecolorset() et imagecolorsforindex().


extrait du manuel php, c'est pas compliqué d'y jeter un oeil, le lien est dans ma signature
Revenir en haut Aller en bas
Voir le profil de l'utilisateur
------------------
Bavard


Nombre de messages: 49
Age: 27
Localisation: Paris
Date d'inscription: 24/07/2006

MessageSujet: Re: Probleme sur la Map   Mer 9 Aoû - 6:12

Citation:
extrait du manuel php, c'est pas compliqué d'y jeter un oeil, le lien est dans ma signature salut


Oui et tu crois franchement que à chaque fois que je lit le code de quelqun je vais vérifier chaque fonction dans le manuel ??

T'arrives à voir du premier coup d'oeil si c'est une fonction qui existe ou qui a été inventée par le développeur ??? T'es trop balèze....

Commencent un peu à me gonfler les modos dans le coin....

_________________
Revenir en haut Aller en bas
Voir le profil de l'utilisateur
transgohan
Langue pendue


Nombre de messages: 68
Date d'inscription: 10/06/2006

MessageSujet: Re: Probleme sur la Map   Mer 9 Aoû - 7:17

A mon avis cela vient du fait que les coordonnées de l'image créé sont de 0,0 à x,y et donc aucuns négatifs.

Syntax>> ce genre de problème se doit d'être réglé par MP plutôt que de poster dans un topic où il n'y a aucun intérêt d'un tel post... Ton post est comparé à du HS là.

_________________
Auberpg: mon jdr en construction
Version beta ouverte: necessite RP !
Revenir en haut Aller en bas
Voir le profil de l'utilisateur
 

Probleme sur la Map

Voir le sujet précédent Voir le sujet suivant Revenir en haut 
Page 1 sur 1

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
Créer son jeu en PHP :: PROGRAMMATION :: Demande d'aide-
Poster un nouveau sujet   Répondre au sujet