I'm creating an island for my game and i have a map middle point where its land and all other is water. How to make a chance calculator for the tile to be land (if close to center 100% chance and lowering the further it's from it)?
so far what I only can do for one side of map:
float centerx=r.mapsize/2*r.tilesize, centery=centerx;
if(position.x<centerx&&position.y<centery){
float distancex = centerx-position.x, distancey = centerx-position.y;
boolean chancex = rr.nextInt((int)distancex)/5==0; boolean chancey=rr.nextInt((int)distancey)/5==0;
if(chancex&&chancey){sprite=AssetLoader.grass;}
}
But it doent look like an island side. Its like tiles exploded from the center.