Did you ever wonder how a complete tower defense source code looks like?
This is your lucky day.
A couple of years ago Ben Lowry, also known for being the founder of Playtomic, made a tower defense game with two game modes: path mode, which is the mode we all are used to play (minions running along a defined path, and towers to be placed on defined spots) and maze mode, where you can place towers anywhere and minions dynamically adjust their paths to reach the base.
Both modes have up to 100 levels, and the name of the game is InkTd
One of the things I liked the most is the feature to upgrade the cannons with various colors, to match with enemy colors. It adds strategy since red enemies can be hit by red towers, green enemies by green towers, and so on.
But I talked about the source code, because Ben shares with us the full source code, more than 40 classes to be studied to make your own tower defense game.
It’s a source code of a great value and I can’t thank enough Ben for giving it for free.
They can be easily customized to meet the unique requirements of your project.