Jump to content
MakeWebGames

Isometric map grid


Dayo

Recommended Posts

i just got a bit bored so decided to make a script to automatically generate a isometric map via PHP you can make it more advanced/read the layout from a database, just got bored so thought i would share it. i know for the more advanced people this will be easy but its for the new people who may think it is hard to dynamicly generate an isometric map

<?php

echo '<div style="width:672px; height:480px;">';
while ($rows<30) {
while ($cols<10) {
	if ($rows % 2!=0) {
		$left = ($cols*64)+32;
	} else {
		$left = ($cols*64);
	}
	$top = $rows*16;

	echo '<div style="background:url(\''.rand(1, 2).'.png\') no-repeat;position:fixed; height:32px; width:64px;  top:'.$top.'px; left:'.$left.'px;"></div>';
	$cols++;
	$top=0;
	$left=0;
}
$cols=0;
$rows++;
}
echo '<div style="position:fixed; height:448px; border:32px solid #000; width:608px; top:0px; left:0px; "></div>';
echo '</div>';

?>

1.png.4f70bfe0b128ef7e019fe8d9c9de4880.png

2.png.3b724156059aa4eda2c52d78477a2859.png

Edited by Dayo
Link to comment
Share on other sites

  • 6 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...