So, I’ve been developing a very basic random terrain system in isometric view. I am simply applying a conversion to my camera to view everything isometric, using isometric tiles. I can do collision detection, and have no problem with the current code. My issue is I have no idea how to draw slopes, or make interesting terrain that’s not just flat. I don’t know how to do supposed “layers” as I can’t find any good tutorials which i’m able to really grasp. Is it all about an offset, but the same tile x y as the tile below it? No idea. I ask because I want to add in buildings, slopes, digging, like an isometric minecraft. I just have no idea how to wrap my head around the tile layering and would really appreciate it if someone could give me an easy to understand indepth explanation of how to perform these layered renderings, or how to render different layers of terrain which are mineable, at all.
Please, anyone.
Right now my current render code is as follows:
// draws tiles based on a radius, follows you and "Streams" your world.
arg2.translate(twoDToIso(-camX+420, -camY)[0],twoDToIso(-camX, -camY)[1]);
camX = (int) (p.px - 960 / 2);
camY = (int) (p.py - 860 / 2);
for (int x =0; x < 100; x++) {
for (int y = 0; y<100; y++) {
float xx= (float) ((rM.map[x][y].x)*32);
float yy= (float) ((rM.map[x][y].y)*32);
if(calcDistance(xx,p.px,yy,p.py)<=15*32){
arg2.drawImage(rM.map[x][y].img,twoDToIso(new Point((int)xx,(int)yy)).x ,twoDToIso(new Point((int)xx,(int)yy)).y);
}
}
public static Point twoDToIso(Point pt){
Point tempPt=new Point(0,0);
tempPt.x=pt.x-pt.y;
tempPt.y=(pt.x+pt.y)/2;
return(tempPt);
}
It might be sloppy but I am new to this so i’m taking easy to understand, and possibly sloppy steps. All i’m doing is generating my tiles in a strictly 2d array and then shifting the camera to the isometric view which seems to work well enough. I also use a radius based rendering so that it’s not drawing every tile, only those within a certain distance.