Build 10 games and learn game development along the way in this fast paced game development course

Get the source code of 12 commercial games, loaded 50+ million times, and learn the secrets of game design

Learn how to make a successful Flash game from a real world example. Fully commented source code

Create realistic Flash physics games from scratch with advanced features, from Angry Birds to Crush the Castle

Make a Flash game like Flash Element Tower Defense – Part 1

November 11th update: part 2 released

One of the most popular Flash games around the web during last months was a game (with some variants) called Flash Element TD, “a Macromedia Flash based Warcraft TD game inspired by Element TD for WarcraftIII”, as says its author, David Scott.

Flash Element Tower Defense

The game concept is simple: there is a road, and some minions walking that road. You have to kill all minions before they reach the end of the road. You can build several facilities to kill minions and earn money to upgrade weapons as the minions get stronger and faster.

In this first part of the tutorial, I’ll cover the minion walking.

It’s a very complex task, that will require almost 30 lines!

Let’s start showing the objects required to make it work

Tower Defense

minion: it’s the evil enemy to kill. I think a blue triangle should look evil enough.

path: it’s the background where the game will take place

Now, a few words about how to develop the concept: in this game there is not enemy artificial intelligence. Enemies walk along a path until they die. This simplifies a lot our work, because the only thing we need to do is to create a list of waypoints defining the path. When an enemy reaches a waypoint, I’ll make it reach another waypoint.

Let’s see the actionscript, all in the first (and only) frame of the main (and only) scene.

Line 1: Attaching the path object on the scene

Line 2: Defining an array containing all horizontal coordinates of the waypoints

Line 3: Same thing for the vertical coordinates. Now waypoints are defined, so the minions will walk until (40,140), then until (140,140), then (140,60) and so on.

Line 4: Setting the delay, in frames, between the creation of the xth enemy and the creation of the (x+1)th enemy.

Line 5: A flag variable counting how many frames passed from the creation of the last enemy

Line 6: Variable telling me how many enemies I have placed so far

Line 7: Beginning of the main function, to be executed at every frame

Line 8: Checking if I haven’t already placed all 25 monsters I want to place

Line 9: If not, increase the variable counting how many frames passed from the creation of the last monster

Line 11: If the number of frames passed from the creation of the last monster is equal to the number of frames I want to pass after the last monster creation…

Line 12: Increasing the variable counting how many monster I placed. I am about to place a new monster!

Line 13: Setting the variable counting how many frames passed from the creation of the last enemy to zero

Line 14: Attaching the monster movieclip outside the screen, because I want it to enter “from above”, and assigning this object to a variable called min (from “minion”)

Line 15: Assigning to the minion (I started with “enemy”, then “monster”, now “minion”… someone should strike for blue triangles rights!) a variable with the number of the next waypoint to reach: zero, because the first element in an array is indexed with zero.

Line 16: Assigning to the minion a variable with its speed. This will become handy in future, when minions will change waling speed during the game

Line 17: Function to be executed at every frame for the minion

Line 18: Calculating the x distance from the current minion position and the next waypoint

Line 19: Same thing for the y distance

Line 20: Checking if the sum of both distances is less than 1 (approx: did the minion reach the waypoint?)

Line 21: If true, then increase the waypoint flag to make the minion move to the next waypoint

Line 23: Determining the angle of the minion according to its direction using trigonometry. If you have troubles with trigonometry, I recommend you to read this tutorial

Line 24: Updating minion’s x position according to its direction and speed

Line 25: Same thing for its y position

Line 26: Rotating the minion facing the direction it’s walking.

And that’s it. The first part is over. You may need to reload the page to see the movie working.

Download the source code and give me feedback

Then move to part 2.

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (150 votes, average: 4.43 out of 5)
Loading ... Loading ...
Learn how to make a successful commercial Flash game from a real world example: get the fully commented source code of Globez, a Flash game played millions of times which generated a four figure income. Limited copies available.

Get it now
Be my fan on Facebook and follow me on Twitter! Exclusive content for my Facebook fans and Twitter followers

This post has 157 comments

  1. Thomas

    on October 6, 2007 at 11:06 pm

    Wicked…

    You never fail to amaze me. All those culy braces :)

  2. Games » Make a Flash game like Flash Element Tower Defense - Part 1

    on October 6, 2007 at 11:49 pm

    [...] unknown wrote an interesting post today onHere’s a quick excerptOne of the most popular Flash games around the web during last months was a game (with some variants) called Flash Element TD, “a Macromedia Flash based Warcraft TD game inspired by Element TD for WarcraftIII”, as says its author, … [...]

  3. GadgetGadget.info - Gadgets on the web » Make a Flash game like Flash Element Tower Defense - Part 1

    on October 6, 2007 at 11:58 pm

    [...] biskero wrote an interesting post today!.Here’s a quick excerptOne of the most popular Flash games around the web during last months was a game (with some variants) called Flash Element TD, “a Macromedia Flash based Warcraft TD game inspired by Element TD for WarcraftIII”, as says its author, … [...]

  4. Riiich

    on October 7, 2007 at 11:40 am

    Wow, i’ve been looking for a tutorial like this ever since those sort of games have started being made. thanx a lot.

  5. www.gamesandgames.info » Make a Flash game like Flash Element Tower Defense - Part 1

    on October 7, 2007 at 8:41 pm

    [...] Emanuele Feronato wrote a fantastic post today on “Make a Flash game like Flash Element Tower Defense – Part 1″Here’s ONLY a quick extractOne of the most popular Flash games around the web during last months was a game (with some variants) called Flash Element TD, “a Macromedia Flash based Warcraft TD game inspired by Element TD for WarcraftIII”, as says its author, … [...]

  6. Robby

    on October 8, 2007 at 4:25 am

    AMAZING!!! Can’t wait for part two!!!

  7. Sushant

    on October 9, 2007 at 7:41 am

    Wow,
    I’ve been visiting your blog for quite some time now….I’ve Learnt so much from you. Its been some time since i wanted to make a flash version of my fav game(DotA). N i’ve been trying to find a good path findin AI ideas for it,as flash is not very good at handling complex algorithms.And As usual u again have given me a new idea to play around with. Keep up the good work.

  8. Frederik J

    on October 9, 2007 at 9:14 pm

    Good as usual, emanuele. Keep it up.
    Frederik J

  9. 0wned

    on October 10, 2007 at 9:55 pm

    great tutorial thanks

  10. harryt

    on October 12, 2007 at 3:10 pm

    nice one, i edited the MC and added a few frames to it so that the MC changes whilst it moves

  11. Samuel

    on October 12, 2007 at 9:42 pm

    Hi Emanuele.

    I’m one of those who check your site several times per week, searching for new fantastic tutorials.

    I have one suggestion that would make this game-tutorial REALLY great: Make it OOP. This game is a incredibly suitable game for Object oriented programming, and I think you could add a entirely other dimension to the tutorial if you followed this tip.

    Kindly,
    Samuel

  12. brandon

    on October 12, 2007 at 10:22 pm

    what program did he use because i really wanna make games so could any1 tell me the program name?

  13. Laserman

    on October 13, 2007 at 2:23 pm

    ???
    to hard :D, needs more basic info

  14. oliver_l1

    on October 20, 2007 at 4:00 pm

    Really great Tutorial!

    Please make a second one.

    Thanks.

  15. jarrod

    on October 22, 2007 at 12:30 pm

    thanks for the info mate,
    having problems opening the source codes when i try opening it in flash mx 2004 i get unexpected file format error message. am i using the right program?

  16. Joshua threlfall

    on October 25, 2007 at 11:32 pm

    Hey, i set the min.speed to 5 and I had some problems where the minions jumped around in one spot.
    other wise this is a sweet tutorial wheres waiting for part 2!

  17. jabs

    on November 1, 2007 at 3:25 am

    Can’t wait for part 2. I’ve been wanting to create a game like this for awhile and have just started working on it. GLad i stumbled across your blog.

  18. brandon

    on November 3, 2007 at 9:48 pm

    Im really looking forward to part 2, is it comming out soon? noowhere else offers a tutorial on how to make a tower defense game and i really want to make one..

  19. Make a Flash game like Flash Element Tower Defense - Part 2 : Emanuele Feronato - italian geek and PROgrammer

    on November 6, 2007 at 9:35 pm

    [...] Welcome to the 2nd part of this tutorial. I recomment you to check part 1. [...]

  20. yogibali

    on November 8, 2007 at 8:58 am

    wow.. that was amazing script…

    Can U make those script more great, by adding the AI script to generate an array of waypoint. :)

    thx alot 4 the tutorial…

  21. zack

    on November 9, 2007 at 3:08 pm

    This is a great tutorial, but I’m having a problem. If my path is not the same as the given one, how do i find out the coordinates of a selected area?

  22. Emanuele Feronato

    on November 9, 2007 at 3:48 pm

    You can find it through mouse coordinates.

    In your main function write

    trace(_root._xmouse+” “+_root._ymouse)

    then move the mouse and copy coords

  23. zack

    on November 9, 2007 at 4:23 pm

    Oh.. Thanks a lot, I’m kind of new to flash.

  24. zack

    on November 9, 2007 at 4:28 pm

    wait.. sorry for double posting but, I’m not sure where to put that code (I’m using Flash Pro 8)?

  25. -

    on November 12, 2007 at 11:53 am

    Hey zack, i did simpler to get coords i think, i just use the window->info panel (or CTRL+I) and while having the focus on the actions window, i move the mouse around the waypoints.

    One little bug is commented by Joshua threlfall, if u make the speed greater than 1 u will get in troubles, this is because….well i dont knowhow to explain i expect that only telling the patch u can understand why doesnt works in that manner
    Just put this in line 20:
    if((Math.abs(dist_x)+Math.abs(dist_y))
    Its a simple matter of gap jumping, u know.

    Oh zack, u must put this code in the first frame of a new layer(created by ur own) called actions by example, selecting the first frame and then open the actions window, paste inside it, be sure of the lower title name is actions:1

    Sorry for my terrible english.
    Congrats by the tut. :D

  26. -

    on November 12, 2007 at 11:57 am

    sorry, the line was incorrect, it was cutted in an amazing manner i dont know, the correct is(line 20):

    if((Math.abs(dist_x)+Math.abs(dist_y))

  27. -

    on November 12, 2007 at 12:01 pm

    urmphh?? sorry again but the post doesnt works well and cut the essential part so i look like a mad….
    The patch is simply reemplace the “if(…

  28. -

    on November 12, 2007 at 12:08 pm

    hahaha this seems a joke, all time cutting my posts i dont know why. The patch. reemplace in line 20 “if(…&lt1)” by “if(…&ltthis.speed)
    Reasons r more or less explained 3 posts before
    Sorry for spaming, the problem was the “&lt” what is an html reserved char and u must write “ampersand + lt”, and first i was disoriented

    I apologize for the inconveniences, sorry for my stupidity xDD

  29. -

    on November 12, 2007 at 12:09 pm

    error again, i dimiss

  30. -

    on November 12, 2007 at 5:08 pm

    Last chance, i swear xD
    Line 20:
    if((Math.abs(dist_x)+Math.abs(dist_y))< this.speed) {

  31. Paul

    on November 13, 2007 at 7:16 pm

    Whenever I put the code in the main frame for the if satement to dry to generate a new enemy….My editor just crashes, so I can never get it to run. Any suggestions?

  32. ben

    on November 13, 2007 at 11:33 pm

    i like cds!

  33. tim

    on November 16, 2007 at 11:42 pm

    Flash MX 2004

  34. Matti

    on November 19, 2007 at 6:14 pm

    He used Macromedia Flash 8 pro

  35. TheInfinity

    on November 24, 2007 at 7:08 am

    I really need help. I just started using this program and found tower defence games very fun. I don’t get how to get to the action script and i don’t get the commands. Do you have to have the items selected before you do those actions? i’mma noob at this ugh… x(

  36. TheInfinity

    on November 24, 2007 at 7:10 am

    srry double posting >.

  37. TheInfinity

    on November 24, 2007 at 7:12 am

    having to post again sorry but, why can’t my macromedia open your sources? keeps saying an error.

  38. Hoi! Koffie? » Tower “Addiction” Defense

    on November 24, 2007 at 9:06 pm

    [...] Make a Flash Game Like Flash Element Tower Defense – Part 1 [...]

  39. zack

    on November 25, 2007 at 5:24 pm

    What program do you use?

  40. Oman3D.com » Blog Archive » Best of the Internet - November 2007

    on November 30, 2007 at 8:30 pm

    [...] Flash Game Tutorial – Element Tower Defense [...]

  41. mr i dont get it :[

    on December 2, 2007 at 1:37 pm

    wow, thats alot of action scripting, i never thought it would be that hard :[ i couldnt even figure out how you got the arow symbol and the background to show up with linkage export path or whatever :S

  42. Luki

    on December 4, 2007 at 12:11 am

    Cool! Will be part 3? With rotating base, and rotating bullets, and attaching new towers? It`s important … :/

    greetings

  43. Stephanie

    on December 14, 2007 at 5:37 pm

    I’m having some issues with the tutorial. For some reason the minion shows up on the screen and looks like its about to follow the path but as soon as the minion hits the background, it just restarts. Please help me

  44. Stephanie

    on December 14, 2007 at 5:38 pm

    I think its something about the delay

  45. Stephanie

    on December 14, 2007 at 5:48 pm

    actually when i put the new_monster = 0; in comment

    if (new_monster == delay) {
    monsters_placed++;
    //new_monster = 0;

    it works but theres only one minion that shows up. Any ideas???

  46. Meepo

    on December 15, 2007 at 8:43 pm

    Augh, im uber-new to flash. I tried to follow this tutorial but when i test movie, all these errors come up. I think its because of the actionscript. What am i supposed to do with it?

  47. ben

    on December 16, 2007 at 6:34 am

    i need help, i cant seem to get the actionscript going. ive done everything it says, but nothin happens when i test it. Can anyone help me?

  48. A

    on December 16, 2007 at 7:06 pm

    This works great except for the fact that when I run it nothing happens at all.

  49. A Gem of Flash Game Tutorials | Newbie Game Programmers

    on December 17, 2007 at 4:22 pm

    [...] a couple of hints on how to make these Tower Defense type games. This is when I came across a post Make a Flash game like Flash Element Tower Defense, but instead of finding 1 great Gem, I found an entire website worth of [...]

  50. greg

    on December 22, 2007 at 5:21 am

    when i play i get no syntax error message but the minion just stays in one place

  51. greg

    on December 22, 2007 at 5:34 am

    nvm, is has to do with linkage

    however, as soon as i got it running, it only spawned one minion,
    what is happening?

  52. pissed off guy

    on December 30, 2007 at 9:06 pm

    look this tut sucks it’s too hard to get. I’ve made every single thing but it doens’t work. Stop making these tuts you’re a horrible explainer

  53. TheInfinity

    on January 2, 2008 at 9:02 pm

    nothings moving -.- and Flash Pro 8

  54. RJ

    on January 2, 2008 at 10:54 pm

    You need Flash CS3 to open the .fla’s given by Emanuele, but anyway, you can copy and paste the actionscript. Don’t forget to create the minion and path movieclips and to link them

  55. TheInfinity

    on January 3, 2008 at 5:49 am

    link them???….MAN i’m an uber noob!

  56. SilverSabre

    on January 5, 2008 at 2:54 pm

    ya im in a simular situation, i made both movie clips and copied the script above but i dont understand linking

  57. TheInfinity

    on January 5, 2008 at 8:05 pm

    ok i got it to work. my “minions” are moving. but when i try to make them faster, they kinda stop at certain points. and stall there for…ever…. -.-

  58. TheInfinity

    on January 5, 2008 at 8:47 pm

    I solved what recently just posted from an earlier post but i have another question. When i test movie in the flash, it’s alright. It works they’re all moving. But when i try the .swf the minions disappear after a certain point on the path (depending on speed) Any ideas?

  59. yikes

    on January 8, 2008 at 1:44 am

    it macromeadia flsh pro 8 im pretty sure :D

  60. With Stephany

    on January 19, 2008 at 1:20 am

    I’m having the same problem as stephany. I just copied the code after making my map and linking the stuff and everything, but whenever a new guy respawns, he moves a bit then just restarts. Any help?

  61. anoyed

    on January 19, 2008 at 7:20 pm

    Yeah, im getting a similar problem… every time I change the speed to 2 or something, they all get stuck when they turn a corner. Any ideas?

  62. stupid

    on January 23, 2008 at 5:44 am

    Nothing is working at all! Help! The minions don’t even appear on screen!

  63. nicp

    on January 24, 2008 at 5:59 pm

    Somethings wrong…im using Flash MX and everything seems to work fine but my coords are all messed up…i put in my own…but they jump around the screen in the begining and they exaggerate the other waypoints…any help?

  64. Desenvolvimento de games « O Coice da Girafa

    on January 25, 2008 at 3:36 am

    [...] Desenvolvimento de games Emanuele Feronato – Parte 1 [...]

  65. Nicolai

    on January 30, 2008 at 8:44 pm

    Eww.. Where do i download that program?

  66. jaasaria

    on February 4, 2008 at 9:38 am

    plss any suggestion on.

    i already created the tutorial but theirs a problem in my work.
    the minion that taking the path is only one. plssss any suggestion.. pllss email me at asaria_ja@yahoo.com
    thxxxxxxxxxxxxxxx
    thxxxxxxxxxxxxxxxxxxxx

  67. Mike

    on February 20, 2008 at 9:12 am

    Hello,

    I am contacting you on behalf of http://www.flashcomponents.net . I’ve read one of your tutorials and I like the way you write. Our site is continuously growing and we recently added a tutorial section. We kindly ask for your approval to allow us to publish your tutorials on our site, mentioning you as the author.
    Of course, we are inviting you to do it yourself, but either way, it would be our pleasure to publish them.

    Kind regards,
    Mike | Flash Components Team

  68. john

    on February 24, 2008 at 2:30 am

    i never made a game in my life befor

  69. jon sploder

    on March 16, 2008 at 8:36 am

    Wow, I never knew flash was pretty much EXACTLY the same as GML :D. Good thing I am fluent, world look out here I come :D. Fantasic tut mate, keep it up!

  70. vub0

    on March 18, 2008 at 7:43 pm

    i am a beginner and i think u need to explain in more detail b cause i dont understand

  71. z3n

    on March 30, 2008 at 4:31 pm

    this tutorial will do little for a beginner. I took a look at it and tried out some of the code, and I have since had to rewrite and replace almost all of it. It is good for hints how to solve some problems, but the code itself is not well suited for a full featured game.

    Example: the use of clipExample.onEnterFrame = function is a bad tree to bark up. The variables that are loaded local to those clips do not update, such as array lengths. So, when that clip loops through arrays (each frame) it is using the length property it got when the clip was loaded.

  72. niki

    on April 2, 2008 at 2:37 pm

    what is the nme of the program u use?

  73. Chris

    on April 9, 2008 at 12:54 am

    What IS the program you used???

  74. Chris

    on April 9, 2008 at 12:54 am

    What IS the program you used???

  75. Chris

    on April 9, 2008 at 12:57 am

    PLEEEEEEEEEEEEEASE tell me where to download it!!!!!!!!!

  76. Alan

    on April 13, 2008 at 10:44 pm

    Please, start from the beginning. What program do you use. Send me every step, please

  77. D

    on April 14, 2008 at 7:04 pm

    It’s flash (CS3 being the latest version, this is actionscript 2 though).. You can download a trial at adobe.com. I would’nt reccommend starting with this tutorial though, it’s not for absolute beginners.

    Linkage:
    Right-click your symbol and choose linkage. Then check “export for actionscript”.

    The “jumping” minion problem is caused by where you’ve set the registry point. It has to be exactly in the middle of you little dude.

  78. digitalt skapande » Tower Defence

    on April 21, 2008 at 2:49 pm

    [...] Part1: http://www.emanueleferonato.com/2007/10/06/make-a-flash-game-like-flash-element-tower-defense-part-1… [...]

  79. stojan

    on April 23, 2008 at 11:58 pm

    OMG its only me or i dont anderstent on what should i sett the codes on the path or minions and when i copy the codes to the minion that i fink is the right i got 7 errors HELP pleas

  80. Zackorith

    on April 26, 2008 at 9:47 pm

    Well personally i though this tutorial was easy, and i understood it all

    i has a loader, money, kills

    but i cant seam to make it so when minion gets to the end you lose a life, and then plays next level…
    so how do i makes lives go down o.0??

    Zackorith2@hotmail.co.uk

    i understood everything else (Y)

  81. flashmxguy

    on April 27, 2008 at 8:21 pm

    i gotta say your tutorial for this sucks.what do i do after i draw the minion cause i really dont know you say stuff but u dont say do that and that .i dont know how to see the minion i just press timeline sfter i draw him and i dont see it on the right so where is it?arrg

  82. ikiki

    on April 30, 2008 at 1:35 am

    i don’t get it to u need some softwar? if so wat one? is it free or not?

  83. Mic

    on May 6, 2008 at 8:24 am

    Thanks for the tutorial. I have a personal project that this is perfect for!

  84. HELP

    on May 8, 2008 at 3:57 am

    wtf? I copied ur actionscript, made 2 movie clips called minion and path
    but nothin works

  85. Van Halen

    on May 10, 2008 at 3:33 am

    where is the main function thing so i can get to see the coordinates? could you just post a copyable picture of the path so i can copy and paste it?

  86. superman

    on May 18, 2008 at 10:37 am

    YES!!!

    i just L- O- V- E when my search works and the actionscript works and my own MODS work… XD

  87. Pvpdave

    on May 26, 2008 at 6:38 pm

    this is so awsome i cant wait to show my class :D ^^

  88. Linder

    on June 2, 2008 at 11:05 pm

    Sorry for being so dumb, but what program is used? I really love TD’s and i got alot of spare time over. So i think I could try to make one, maybe it will be good :).
    I would like to have an answer as soon as possible.

    Linder

  89. Matthew Baumann

    on June 11, 2008 at 1:33 am

    Hi. I’m using Macromedia Flash MX Professional 2004. I was wondering if anyone could help me get started with this. I can’t get this to work. Any help would be very much appreciated. You can reach me at mattbaumann@hotmail.com

  90. kid programmer

    on June 27, 2008 at 3:16 am

    OH the program is called flash. i have the flash 5. You can buy the new version 8 for like 100 dollars lol. Or you could get an old one. XD

  91. kid programmer

    on June 27, 2008 at 3:58 am

    this doesn’t work on flash five :(

  92. daniel

    on June 28, 2008 at 1:06 pm

    Hello,
    Just to thank you on a great tutorial it helped alot.

    Dan

  93. kid programmer

    on June 28, 2008 at 9:17 pm

    i was wondering could you translate this to actionscript 1.0? Flash 5 doesn’t use actionscript 2.0. Sorry for all the comments.

  94. MaTt

    on July 11, 2008 at 3:52 pm

    my minions do nothing but stnd still email me if you can fix this stickdude45@hotmail.com

  95. ludde

    on July 18, 2008 at 6:14 pm

    this is cool but i need win rar

  96. Mephistopheles

    on July 18, 2008 at 7:56 pm

    This is all great, but what do we do it on?

    Is there like a program you used?

  97. Adobe Flash CS3- AS3 and AS2 game tutorials roundup | Lemlinh.com

    on August 19, 2008 at 6:35 pm

    [...] Part 1 [...]

  98. Shedokan

    on August 19, 2008 at 9:11 pm

    How can I make it with a lot of towers?

  99. ErzeN

    on August 26, 2008 at 9:16 am

    wooowww that is soo cool :D

  100. Frogger

    on August 29, 2008 at 9:34 pm

    Brandon, this is a little late, but if you don’t know what Flash is, then it will really be hard to make games, let alone use it. So anyway, the program he used is Macromedia Flash.

  101. Alexius Lengele

    on September 2, 2008 at 6:02 pm

    u guys are noobs

  102. Adobe Flash Tutorials Part 2

    on September 9, 2008 at 4:15 am

    [...] Tower Defense the concept is : there is a road, and some minions walking that road. You have to kill all minions before they reach the end of the road. You can build several facilities to kill minions and earn money to upgrade weapons as the minions get stronger and faster. [...]

  103. a person who needs help

    on October 14, 2008 at 2:58 am

    hey emanuele this tut is awesome but… the thing is that when I load the source it says unexpected file format… so I need help

  104. Person Who Need Help

    on October 14, 2008 at 3:44 pm

    Please… My Minimon not moving att all…
    Please Help Me….

  105. gotoAndBlog(); » Blog Archive » Tutorials for 5 different Flash game genres

    on October 15, 2008 at 11:16 am

    [...] http://www.emanueleferonato.com/2007/10/06/make-a-flash-game-like-flash-element-tower-defense-part-1… [...]

  106. Vincent

    on October 23, 2008 at 11:18 pm

    please help! i got the minions to walk okay and everything but i want them to be spaced out more! how can i do this?

  107. Vincent

    on October 23, 2008 at 11:20 pm

    never mind my minion was a little to big!

  108. Tom

    on November 16, 2008 at 11:40 pm

    Yes, i have the same problem as “a person who needs help on October 14th, 2008 2:58 am” I would like to try this out so if anyone could help me, send me an email at tomolom100@hotmail.co.uk Thanks alot everyone…and by the way, good tutorial!

  109. luke

    on December 23, 2008 at 9:49 pm

    What am i using to create the path and arrow

  110. GregRodregez

    on December 26, 2008 at 2:14 pm

    Im using flash pro 9 but using action script 2.0. When i put in the code (copy paste) i need to delete the numbers. Afterwards i check it and it says i need on clip event handler. so i put that in. then i run the game and the minion just stands there like its retarded. can you help me?

  111. Christian

    on February 3, 2009 at 8:56 pm

    HELP
    is this all done in LOGO???? or some other web sight!!! lol man i sound nooby =(
    PLEASE HELP

  112. POTTER

    on February 4, 2009 at 8:40 am

    Could you please help me. what is that program called that you are using? message me please!

  113. Ultimate List Of 40 Quality Flash Tutorials For Your Animated Desire | The Theme Blog

    on February 11, 2009 at 7:26 pm

    [...] Make a Flash Game Like Flash Element Tower Defense Flash Element TD is awesomely addictive. Learn how to create your own. [...]

  114. Reece

    on February 15, 2009 at 4:38 am

    okay.. ive done it all, but there are 14 errors,
    some one please make a video tutorial on this, message me on http://www.youtube.com/aldeed
    ~Thanks

  115. devildog

    on March 1, 2009 at 2:12 pm

    sombody here made this successfully with no problems?… i got 1 big problem…

    when i start gamae my minions are walking… when they look like they gonna start walking the road, they restart? and only 1 mob i got walking… Could it be the one mob that gets summoned there for starting as a “new mob”?

    answer on jesper.j.b.baunsgaard@gmail.com (email) plzz

  116. bud

    on March 11, 2009 at 8:52 pm

    wat program have u used

  117. Mushyrulez

    on March 13, 2009 at 5:42 am

    Everybody, the program is Macromedia Flash, a program that you have to buy at adobe.com…
    Great tutorial, but I think you made it too complex for the absolute beginners, you might want to explain it a TINY bit more. Or start more basically.

  118. Gardengnomes

    on March 15, 2009 at 8:39 pm

    this doesnt work!! it only works when i Dl the source file

  119. arszt

    on March 22, 2009 at 2:45 am

    Nice tutorial, but why did this page open up at least 10 popups and try to attack my computer? When I clicked on this page the popups came up and then Norton said that iijyjcthr.com tried to attack my computer.

  120. Project 3 concept « Isaac Fowler Design

    on May 8, 2009 at 3:50 pm

    [...] are some more nice links: A list of game tutorials A pool game with high scores tutorial Tower Defense tutorial Matching game tutorial A blog that supposedly has amazing Flash resources, although I haven’t [...]

  121. Canadian Flash Helper

    on May 13, 2009 at 4:19 am

    To most, this tutorial would seem daunting yet they don’t know what A LOT of coding is…30 lines is beginning stuff. If they want to know hard flash coding then they should take a look at some of my games I’ve created (spaceInvaders, recreation of bloons tower defense, etc) that takes up about 8-15 external action scripts worth of code

    but the tutorial was pretty good…i needed some ideas on how to improve my bloons tower defense game
    i think i might have found a couple of ideas

    overall though you have great ideas in coding which would even help me out cause i have the problem of having repetitive lines of code making a function last sometimes up to 100 lines

  122. Jike

    on June 23, 2009 at 4:29 pm

    I just curious how do you make all space between the lines in the roads even.

  123. Make a Flash game like Flash Element Tower Defense | Tutorial Collection

    on July 2, 2009 at 5:09 am

    [...] View Tutorial No Comment var addthis_pub="izwan00"; BOOKMARK This entry was posted on Thursday, July 2nd, 2009 at 8:38 am and is filed under Adobe Flash Tutorials. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site. [...]

  124. pligg.com

    on July 10, 2009 at 8:18 pm

    Make a Flash game like Flash Element Tower Defense…

    Learn how to make a Flash game like Flash Element Tower Defense…

  125. plasmacannon

    on August 3, 2009 at 7:26 am

    o_0 need help it didnt work it keep complianing that it must appear onclipevent all other stuff

  126. Corey

    on August 7, 2009 at 7:10 am

    ok im confused

    1 where do i input all this txt is there a certain software?

    2 how do i make the towers the bullets the minions and the background? do i just draw them or something?

    3 how would i know where the waypoints would be

    plz e-mail me if u have an answer

    flamethrower550@comcast.net

  127. mal

    on September 18, 2009 at 12:54 am

    hi i have done everything right i created the movie clips linked them and copied the Action Scripts.
    it works fine apart from the “path” movie clip is in the upper left hand corner i was just wondering how to move it to mach the way points.

    thanks oh and great tut

  128. lolicon

    on September 22, 2009 at 11:38 am

    wicked sick so that is how u do it

  129. nobody

    on November 24, 2009 at 5:47 pm

    how come all the action code things just go up to the 8th line and stuffs the rest in there

  130. Pafke

    on December 16, 2009 at 2:01 pm

    Does anyone know a similair tutorial in AS3?

  131. Nihem

    on December 31, 2009 at 12:03 am

    it doesn’t work for me!

  132. NicktheMan

    on January 20, 2010 at 4:34 am

    How do u make a path? and how do i add the actionscript? please help a person that knows nothing!

  133. Cameron Bell

    on February 21, 2010 at 3:56 am

    i just got flash cs3 and want to know… HOW THE HELL DO YOU GET INTO THE PART OF FLASH WHERE YOU CAN ADD TEXT (as shown on diagram 1)

  134. Laltu Sarkar

    on March 3, 2010 at 3:38 pm

    want to a tutorial of flash game

  135. MAST3RSONICX

    on April 7, 2010 at 4:46 pm

    In my swf. My minions won’t move and I only have 2 scenes. The main menu and the game. Please send me the fla to see what I did worng or upload to youtube.

  136. Tyler

    on April 27, 2010 at 10:39 pm

    i alrdy hav a game goin i just need 2 no how 2 make a tower

  137. wow gold farming wotlk

    on May 22, 2010 at 8:11 pm

    i cant get mine 2 work it installs but goes on to the downloaderits boring

  138. Alexandre Colella

    on July 18, 2010 at 8:52 pm

    Hei Emanuele! Please!
    Do an AS3 tutorial!

    Thanks!

  139. marciorosa.org » Make a Flash game like Flash Element Tower Defense – Part 1 - Complete listing Tools and resorces for the ultimate web developer

    on September 9, 2010 at 4:26 am

    [...] start showing the objects required to make it work , rewrite the code you can find in the original post by Emanuele Feronato. Download the source code and give me feedback by Emanuele [...]

  140. Dumah

    on September 20, 2010 at 11:37 pm

    Could you please please make an AS3 version of this tutorial

  141. flash oyun yapmay? ö?retecek 5 ders « MORYAZMA

    on September 27, 2010 at 8:44 am

    [...] kule savunma (tower defence) [...]

  142. Lostaname

    on November 9, 2010 at 5:15 pm

    Flash noowbie here: How do I make a Tower Defence game in Adobe Flash Prof. CS5? This explanation completely loses me.

    *Has Gem TD-like game aspirations*

  143. game

    on December 10, 2010 at 8:47 pm

    When I try to open your source code, it says unexpected file format. Help please!

  144. abdullah

    on January 8, 2011 at 4:57 am

    HI how can you make a game like those games

  145. Get Perfect and Useful Flash Tutorials | Webblog360

    on February 17, 2011 at 8:54 am

    [...] Make a Flash game like Flash Element Tower Defense [...]

  146. Dora

    on March 20, 2011 at 5:41 pm

    Really helpful code. Thank you.

  147. Asmodeu

    on April 29, 2011 at 7:09 pm

    Is there any adaptation of this tutorial to any of the newer tools, such as AS3 in Flash CS5 ?

  148. » 40 Top Flash Game Tutorial Roundup stuff i like

    on July 1, 2011 at 10:01 pm

    [...] 29. Make a Flash game like Flash Element Tower Defense – Part 1 [...]

  149. Dap

    on July 4, 2011 at 3:30 pm

    It doesn’t work ….?

  150. Andrew

    on September 15, 2011 at 2:36 pm

    I translated this into AS3 , and applied the code to only one instance, for testing purposes. The instance goes zig-zag. Why is that? What needs to be changed?

  151. 3rb

    on November 30, 2011 at 1:20 am

    Could you please please make an AS3 version of this tutorial?

  152. I want to be an artist, you want to be a coder « Over00

    on December 4, 2011 at 11:40 pm

    [...] to create games these days. Take a look at Game Maker, RPG Maker or do like many coders and create your own tower defense game from a tutorial (no imagination required!). If you’re feeling adventurous build your own MMO with Realm [...]

  153. oyun

    on January 11, 2012 at 10:38 pm

    Like tower defence game. =)

  154. 32 Best Action Script 3 Game Tutorials

    on June 16, 2012 at 10:49 am

    [...] 24. Make a Flash game like Flash Element Tower Defense – Part 1 [...]

  155. How to develop a tower defense game

    on January 6, 2013 at 1:22 am

    [...] Flash & another Flash & more Flash tutorials [...]

  156. Noob

    on April 11, 2013 at 5:43 am

    so it works good so far, but my only issue is that my minions always start in the top left corner, do I need to add the origin points in the waypoint coordinates?

  157. Coudray

    on May 28, 2013 at 3:20 pm

    @Noob

    Yup, you need to adjust the waypoint_x and waypoint_y of the new Array that he had created, the right side of the screen is 0 (x) while the upper side of the screen is 0 (y)

Thank you for the download!!

I hope you will find it useful and make something interesting out of it

To keep up to date with the blog, why don't you like my Facebook page and follow me on Twitter?

Want to learn more? Don't miss this:

Learn how to make a successful commercial Flash game from a real world example: get the fully commented source code of Globez, a Flash game played millions of times which generated a four figure income. Limited copies available.

Get it now

×