VBfx / Tile tutorial / Conclusion


You just learned how to manage units in your tile engine and how maps and layers can work together. Instead of having a fixed grid we used individual positions for each unit and a map where the units are registered so we can keep track of them. Collisions are getting quite easy because we can use the units map to perform collision checks.

In the sample code you can move around the first unit with the left mouse button to check your collision code. Also I added a short code to draw rects wherever a unit is registered on the map. Just run the sample code and you'll see.

Where to go

We didn't yet touch unit animations but that's only a small step from here. More important things to get are AI and path finding but this is getting quite more advanced. However these topics will be covered in later tutorials so stay tuned!