I have this code right now:
private void generateLevel() {
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
tiles[x + y * width] = random.nextInt(4);
}
}
}
Which allows this method to work:
public Tile getTile(int x, int y) {
if (x < 0 || y < 0 || x >= width || y >= height) return Tile.voidTile;
if (tiles[x + y * width] == 0) return Tile.grass;
if (tiles[x + y * width] == 1) return Tile.stone;
else return Tile.water;
//return Tile.voidTile;
}
Which returns this result:

What I want is smooth, rounded islands with random stone deposits here and there. Would perlin noise be overkill for this? I figured I could just generate a tile, check the tile id next to it and then place it down if the tile adjacent is of the same type. But that would create endless expanses of the same tile. Any help?
The first step I would take is to create objects out of anything on your domain level:
Now we have code that will generate an island with all it’s random deposits. The only thing that is left to do is actually place these islands. I’m going to keep it simple and only add one to the map but I’m sure you can figure out how to add more than one (I’ll leave some comments with my ideas):
Ok, now we’ve got all the data we need. This brings us to the final point of actually drawing it onto the screen using tiles. I’m not too experienced with this subject, so this might be inefficient, but it should serve as a launching point.
Some of the functions I’ve generalized (like drawTile(int x, int y, TileType type) because I don’t know how you are drawing the tiles to the screen).
So that’s basically it – it’s not too bad.
You could always go a step further and add tiles that are mostly water but with some shore line. In order to do that you would have to check if the tile you are drawing is an edge or a corner:
Here you can see 2,9, and 4 are all edge tiles. 1, 3, 8, 0 are all corner tiles, and 5 is an interior tile. When you recognize a tile as being a corner then you have to pick all the attached water tiles and draw them as “coast” tiles:
There all the x’s would be coastal tiles.
I hope this helps a bit.