- [Voiceover] Now, we're ready to add…even more type of decoration to our island…lets go back into the map class.…At the top of the map class…lets add three new items to our iNum,…we'll start with Towns, we'll set this equal to 19,…we'll do Castle,…which is equal to 20,…and finally we'll do Monster, which is equal to 21.…This will represent all the tiles we'll have…in our tile map template.…Next lets go down to our Create Island…and we'll add in these new values.…

We'll create a float for the town percent,…we'll create a float for the monster percent,…and lets add an additional float called lake percent.…This is going to be a special type of decoration.…What we're going to do is take randomly take certain tiles…and turn them into lakes.…Then when we do the erosion code,…not only will we get the outside of the map,…but we'll also get the inside points around lakes…to give it a more organic feel…as it erodes the coastlines…throughout the entire map.…

Before we get to that though,…lets go ahead and add our new decoration method calls.…

Resume Transcript Auto-Scroll

Author

Released

5/16/2016

Learn how to build randomly generated 2D maps for role-playing and real-time strategy games with Unity 5. Jesse Freeman focuses on the basics of random map generation by teaching you how to create island-based terrains, and works his way up into more advanced techniques such as resizing the map, decorating it, and eventually creating large-scale maps with individual continents. He'll add trees, mountains, dungeons, and castles to make the map more fun to explore. He'll also teach you how to create a camera script that scrolls around the map with the mouse, and set up autotiling to give the map's coastlines a more organic look. In the end, Jesse will show you how to build an authentic 8-bit style map generation tool—perfect for your next 2D RPG game.