

Where you can find the Texture and Shape offset for the Tiles To fix this, we need to go inside of the tileset data and offset the texture and shape. Because my sprites are positioned at the bottom on the PNG file, the tiles are drawn below their coordinates on the grid. I am not sure if you ever tried to manually place tiles on the tilemap, but if you did you might have noticed something funny. This is only the first part of the solution. If it was this easy, why didn’t you just do it last time? Inside of the tilemap properties we can enable Y Sort, and change the Tile Origin from Top Left to Center. Thankfully Godot 3.2.1 has some functionality built into the tilemap node that will help us out with this. Now we can focus on getting the player to render behind the walls. With that additional little bit of code, the maps that this algorithm generates will look a lot cleaner, and will not have random walls sticking out like a sore thumb in our rooms. If get_cell(x-1, y) = GROUND & get_cell(x+1, y) = GROUND & get_cell(x, y-1) = GROUND & get_cell(x, y+1) = GROUND: Inside of our _generate_map() function, right after the nested loop that is used to flag walls (right before we move the player at the end), we can make another nested for loop that will check for walls, and if the wall has a floor on all 4 sides, we just turn it into a floor. There are examples in this screenshotįixing this little issue doesn’t take a whole lot of extra work. You may have seen them yourself if you followed the last tutorial.

Currently the random walk can sometimes leave a single wall tile surrounded by floor tiles. So in this final part of the tutorial we are going to be adding the finishing touches to this little project.īefore we get working on the sprite depth issue, I want to first address an issue that will help clean up the rooms that the algorithm generates. What we did not have working properly was sprite depth, resulting in the player always rendering above the walls. Last time we worked on this tutorial we had the isometric world being created, the player being moved to the center of the map and collisions with the tilemap working properly.
