Hey all, i would like some help with an idea i have for my game i am making.
The map is a large 100x100 square grid, now this is to big to display all at once, so i am wondering how to affectively reduce the size so u can only see say 10 squares at a time.
So say i have a top link which lets u go up in the map
if($y-5 > 0) {
$newY = $y-5;
$top_nav = "<a href='map.php?x=$x&y=$newY'>Up</a>";
} else $top_nav = "Up";
Then i have a left link which lets u go left in the map
if($x-5 > 0) {
$newX = $x-5;
$left_nav = "<a href='map.php?x=$newX&y=$y'>Left</a>";
} else $left_nav = "Left";
Then i have a right link which lets u go right in the map
if($x+5 < 100) {
$newX = $x+5;
$right_nav = "<a href='map.php?x=$newX&y=$y'>Right</a>";
} else $right_nav = "Right";
Then i have a bottom link which lets u go down in the map
if($y+5 < 100) {
$newY = $y+5;
$bot_nav = "<a href='map.php?x=$x&y=$newY'>Bottom</a>";
} else $bot_nav = "Bottom";
Now this works, what i am wondering is hwo to display the images?! They are all stored in a mysql database.
the database table is like so
world_id int(11) NOT NULL auto_increment,
x int(11) NOT NULL,
y int(11) NOT NULL,
village_id int(11) NOT NULL,
image varchar(255) collate latin1_general_ci NOT NULL,
PRIMARY KEY (world_id)
I was thinking having a for loop to display them but i am not entirely sure. Any help would be much appreciated.