Tutorial: Making a Tower Defense Game

Hello Everyone :slight_smile:

I’ve finally got around to making another tutorial, a Tower Defense game! This is probably the most advanced (for maths anyway) tutorial yet, but hopefully the best one as well.

Just to quickly sum up the tutorial, it is a very basic tower defense game but it should help you with all the key areas; tower placement, enemy movement and tower firing calculations. There isn’t any tower upgrades in it as i thought i would leave the more interesting parts for you guys to make :slight_smile:

If you want to take a look at the tutorial, then please follow the link below (also theres a video there!):
Tutorial: Tower Defense for iOS

The code itself has been made in such a way that it’s very easy to add new levels to straight away. Simply copy and paste some of the “level.lua” files, edit some of the information in them, add as many new levels as you like and then simply change 1 line of code in the “gameInfo.lua” file (line 254) to tell the game how many levels there now are. Its as simple as that!

Please feel free to use the code however you wish and also feel free to share the tutorial with your friends :smiley:
I hope some of you find it helpful!
Any questions or suggestions for new tutorials then comment or get me on Twitter or Facebook.
Thanks,
Jamie Trinder - Technical Director
T and G Apps Ltd. [import]uid: 69826 topic_id: 29406 reply_id: 329406[/import]

I want to thank you so much for having sample code of a TD game. That was a really great job you did. Thank you again, and have a great day. [import]uid: 17058 topic_id: 29406 reply_id: 118150[/import]

Hey Jamie - looks great!

Wanted to point you to this thread, last comment (before mine);
http://developer.coronalabs.com/forum/2012/06/28/download-image-documentsdirectory-then-show-scene

Peach :slight_smile: [import]uid: 52491 topic_id: 29406 reply_id: 118165[/import]

Thanks sebitttas, glad you like it.

Thanks Peach! Oooo Jim! Glad he liked my work, thanks for the link :slight_smile: [import]uid: 69826 topic_id: 29406 reply_id: 118171[/import]

Jamie ,

As I said earlier on Twitter, THANKS FOR PRODUCING IT!
One more AMAZING tutorial from TandG Apps right into our Corona community! :slight_smile:
+1 for you mate.
Keep it up!
Rodrigo. [import]uid: 89165 topic_id: 29406 reply_id: 118185[/import]

Tower Defence games are probably my favourite type of game in the iPad, I have about 15 installed.

Always wanted to do one but had no idea where to start and also the competition is good.

For anyone that’s interested my most played tower defence game is Tower Madness HD, graphics are not the best but they have nailed the playability factor.

Dave [import]uid: 117617 topic_id: 29406 reply_id: 118243[/import]

Tower madness is a pretty fun game, I still play it from time to time.

Tower defence games are great, before starting this tutorial two days ago I had no idea about how to make one, but luckily it wasn’t too hard to figure out :slight_smile: I’m really tempted to make a full tower defence game now! [import]uid: 69826 topic_id: 29406 reply_id: 118302[/import]