From the course: Unity 5: 2D Movement in an RPG Game

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Modify the map to hide tiles

Modify the map to hide tiles - Unity Tutorial

From the course: Unity 5: 2D Movement in an RPG Game

Start my 1-month free trial

Modify the map to hide tiles

- [Voiceover] At this point, our map is kinda boring. As the player moves around, you see everything that you can go to. One of the things that we can do to make this a little bit more interesting is by adding something called fog of war. Fog of war was made popular in real-time strategy games, and it blacks out parts of the map, allowing you to see only the tiles that you've visited. In order for us to do this, we're gonna need to modify the current random map generation logic. Let's go into the Scripts folder and open up the Tile class. One of the things we need to do in order to implement a fog of war is to keep track of the tiles we've visited. Let's add two new public fields. The first will be a public Boolean, and we're gonna call this visited. The second is going to be a public int, and we're gonna call this fog of war autotileID. Just like the autotileID above, we're gonna keep track of a special autotileID just for tiles that we've not visited. Now it's time for us to…

Contents