First of all. Im new here, so hi everyone im Jonas. And i believe you will get to see alot of me lol
Now for my question.
I'm sitting here with a little problem. I would like to have this loop, that execute a gamemap for isometric in a Zig-Zag layout (A diamond layout would be nice 2. Or both if you know how to.)
the problem is i cant get it to work out!
Img-Length: 64
Img-Height: 32
If you know how to make a Diamond layout. i would like that one aswell.
Here is the code i made up yesterday (Ofcourse it dont work. Was really tired 2 so might be some weird stuff lol)
But im sure, that it's possible to make it 100 times easier.
Code: Select all
function MakeWorkSpace($Lsize, $Hsize, $Name) {
$TotalSize = $Lsize * $Hsize;
$j = 0;
$k = 0;
$i = 0;
$pos_l = 0;
$pos_t = 0;
$count1 = 0;
$count2 = 0;
$less = FALSE;
for ($i = 0; $i <= $TotalSize; $i++) {
for ($j = 0; $j <= Lsize; $j++) {
print '<div id="'.$i.'" style="background-image:url(image/Untitled-9.gif); z-index:'.$i.'; width:64px; height:32px; position:absolute; left:'.$pos_l.'px; top:'.$pos_t.'px;"></div>';
$pos_l = $pos_l + 64;
if ($j <= $Lsize) {
$pos_t = $pos_t + 16;
$pos_l = 32;
}
}
for ($k = 0; $k <= $Lsize -1; $k++) {
print '<div id="'.$i.'" style="background-image:url(image/Untitled-9.gif); z-index:'.$i.'; width:64px; height:32px; position:absolute; left:'.$pos_l.'px; top:'.$pos_t.'px;"></div>';
$pos_l = $pos_l + 32;
if($k <= $Lsize -1) {
$pos_t = $pos_t +16;
}
}
}
}And also, once again. If you dont know how to make the Zig-Zag, but know how a Diamond shape tileset is made please feel free to post that one 2! Or if you know both post both i will appreciate alot.
Many thanks, and appreciations Jonas