Updated tutorial_tilemap (markdown)

reduz 2014-04-18 20:53:02 -07:00
parent 111285e19d
commit d1fdfca8c2

@ -35,6 +35,23 @@ Sounds like a lot of requirements, so here's a screenshot that shows where every
<p align="center"><img src="images/tile_example.png"></p>
Continue adding all the tiles, adjust the offsets if needed (if you use multiple tiles in a single image) unless there is a sprite per each tile. Again, as always, remember they have to be centered and their names must be unique.
<p align="center"><img src="images/tile_example2.png"></p>
###Collision
To add collision to a tile, create a StaticBody2D child for each sprite. This is a static collision node. Then, as a child of the StaticBody2D, create a CollisionShape2D or CollisionPolygon. The later is recommended because it's easier to edit:
<p align="center"><img src="images/tile_example3.png"></p>
Finally, edit the polygon, this will give the tile a collision. **Remember to use snap!**. Using snap will make sure collision polygons are aligned properly, allowing a character to walk seamlessly from tile to tile.
<p align="center"><img src="images/tile_example4.png"></p>
Keep adding collisions to tiles untile we are done. Note that BG is just a BG so we don't care about it.
<p align="center"><img src="images/tile_example5.png"></p>