Dayo Posted June 23, 2012 Share Posted June 23, 2012 (edited) 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>'; ?> Edited June 23, 2012 by Dayo Quote Link to comment Share on other sites More sharing options...
Spudinski Posted June 24, 2012 Share Posted June 24, 2012 There's no consistency? Mind to elaborate why? Quote Link to comment Share on other sites More sharing options...
Dayo Posted June 26, 2012 Author Share Posted June 26, 2012 what do you mean by "consistency" Quote Link to comment Share on other sites More sharing options...
Mint Berry Crunch Posted December 27, 2012 Share Posted December 27, 2012 Sorry for the necromancy but this looks like a very neat thing to share :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.