Correct Isometric block spawn

hey jgo,

how can i fix my isometric block engine so that it looks correct?

here it is now:

here is the code used to generate


size=32;
  for(x=1; x<width*mapSize;x+=size){
	    	  for(y=1;y<height*mapSize;y+=size){
b.addBlock(new ObjTest(x,y);..this is what is being made


}
}

any help would be awesome, thanks

Sigh… please read up on what a isometric renderer actually does.

Indeed, at least put some effort. Seriously.

im nit trying to make any thing fancy but i will

That made me ‘lol’ :>

But it’s now forcing me to make a isometric tile engine 0_0 (First time)

You, Mr., need to improve some things…

  1. Format your code. Even if it’s in the internet. And use // comments… :slight_smile:

int size=32;
for(x=1; x<width*mapSize;x+=size) {
    for(y=1;y<height*mapSize;y+=size) {
        b.addBlock(new ObjTest(x,y); // this is what is being made
    }
}

Or better: Format it right :smiley: Anyways, I like that you didn’t start like many other, who simply got here and asked how to do that without having done anything. Also, the code to be changed is already given, so guys, the answer is so simple? :confused: Anyways :slight_smile:

The solution: Put less space between the y positions of your objects, because you’re not viewing from the top anymore, but from the side and also ‘indent’ objects at each 2nd row:


// I changed the code from 
for(int x = 0; x < mapSize; x++) {
    for(int y = 0; y < mapSize; y++) {
        int xoffset = 0;
        if (y % 2 == 0) // every second row
            xoffset = width / 2; // Indent the row

        b.addBlock(new ObjTest(xoffset + x * width, y * (height / 2)); // the magic happens here
        // The two for-loops don't iterate through the
        // world pixel-based anymore, but _block_ based.
        // So I'm iterating the column and rows.
    }
}

The equation got more complicated, but that’s the nature of isometric stuff.
More information:`

Hope that helps :slight_smile: