Kod:
function checkPosition($posx1, $posy1, $posx2, $posy2){ if($posx1 != $posx2 && $posy1 != $posy2){ return true; } else{ return false; } } function checkFieldUnder($id, $to_top, $to_left, $width, $length){ 'y' => $to_top, 'x' => $to_left ); $false = true; 'y' => $itemspos[13], 'x' => $itemspos[14] ); if($itemspos[0] != $id){ $toposx = $topos['x']; $toposy = $topos['y']; $checkposx = $checkpos['x']; $checkposy = $checkpos['y']; $tpxw = $toposx + $width; $tpyl = $toposy + $length; while($toposx != $tpxw && $toposy != $tpyl){ if(!checkPosition($toposx, $toposy, $checkposx, $checkposy)){ break; $false = false; } else{ if($toposx != $tpxw){ $toposx++; } if($toposy != $tpyl){ $toposy++; } } } if($false == false){ return false; } else{ return true; } } } }
Prosiłbym o pomoc i/lub podpowiedzi
