W moim skrypcie wyświetlania mapy z gry gracza jest problem z ruchem kamerą.
Kod wygląda tak:
$title[pass] sprawdza czy gracz może tam iść.
<?php //showing the current parameters //Poruszanie kamerą if ($gridx == $x +1 and $gridy == $y){ if ($title[pass] == 1){ $left = (($x*32)*-1)+216; } } if ($gridx == $x -1 and $gridy == $y){ if ($title[pass] == 1){ $left = (($x*32)*-1)+223; } } if ($gridx == $x and $gridy == $y-1){ if ($title[pass] == 1){ $top = (($x*32)*-1)+216; } } if ($gridx == $x and $gridy == $y+1){ if ($title[pass] == 1){ $top = (($x*32)*-1)+223; } } ?> <!--grid table--> <div id="main-window" style="width: 450px; height: 450px; overflow: hidden; position: relative;"> <div id="scrolling-section" <table width="750" cellspacing="0" cellpadding="2" border="0">
Problem w tym, że te $top i $left w warunkach nic nie zmieniają.
A gdy przed warunkami dam:
//showing the current parameters $left = (($x*32)*-1)+216; $top = (($y*32)*-1)+216; (...)
to wtedy pozycja się zmienia.
Ale warunki są potrzebne aby kamera ruszała się zależnie od ruchu gracza. Niestety zmienne top i left w warunkach nie działają.
