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

Welcome to the 2nd part of this tutorial. I recommend you to check part 1.

In this tutorial, we will place our first base, and it will start to fire.

Let’s have a look at the objects:

Tower Defense

base: it’s the base

bullet: it’s the bullet the base will shoot

cant_build: it’s the area where you can’t build a base

minion: already explained in part 1.

path: already explained in part 1.

range: it’s the firing range of the base

Now, a little actionscript all in the first frame:

Line 1: Defining the base range

Line 2: Defining if the base can be placed

Line 3: Defining if the base has been placed

Line 5: Attaching the cant_build movieclip

Line 6: Attaching the range movieclip and setting its width and height to match base_range

Line 7: Attaching the base movieclip

Line 36: Function to be executed for the base at every frame

Line 37: If the base is not already placed…

Lines 38-39: Move the base to the mouse pointer

Line 40: Set the transparency of the range to 100 (fully opaque)

Line 41: Updating can_be_placed to true

Line 42: If a corner of the base is over the cant_build area…

Line 43: Setting the transparency of the range to 0 (fully transparent)

Line 44: Setting can_be_placed to false

What I’ve done: I let the player move the base with the mouse. If the base can’t be placed, because it’s over the walking path, I hide the range to make the player know he is on an area where he can’t build.

Line 48: Function to be executed for the range at every frame

Lines 49-52: Same thing of lines 37-39… if the base has not been placed, then move the range with the mouse

Line 54: Function to be executed when the player clicks the mouse

Line 55: If the base can be placed…

Line 56: Then set placed to true. Now the base is placed

Look: you can now place your base, but only outside the walking path.

Now, we will make the base fire at the foes

Line 4: Setting the firing variable to false. Now the base is not firing

Line 34: Performing an hit test between the minion and the bullet. At this time in the script we haven’t already met the bullet, but anyway at this time I am performing this test

Line 35-37: If the test is positive, then remove the bullet and the minion that was hit (at this time minions do not have energy, so my turret is one shot one kill), then set firing to false.

Lines 40-41: Calculating x and y distance between the bullet and the minion

Line 42: If the distance between the bullet and the minion is less than half the range (in our case the range is the diameter of the circle, so half the range is the radius)

Line 43: Boom! The turret fires!

Line 44: Placing the bullet on stage, in the same position of the turret

Line 45: Setting bullet direction, accordind to its x and y distances from the minion

Line 46: Function to be executed for the bullet at every frame

Lines 47-48: Moving the bullet using trigonometry. If you don’t know what is trigonometry, then head to this tutorial

Line 49: Checking if the bullet is flying out of the stage

Lines 50-51: In this case, remove the bullet and set firing to false again to let the turret fire once more

And here it is our firing turret. You may need to reload the page to have the minion walking while you will place the turret and start killing them.

The fire rate sucks a lot, and the same thing does turret’s AI. But I got all those features in only 81 lines, I am sure I will create the complete game in less than 500 lines.

Not today, anyway. Today, download the source and if you have suggestion… just leave a comment.

  • Pingback: Make a Flash game like Flash Element Tower Defense - Part 1 : Emanuele Feronato - italian geek and PROgrammer()

  • PLEASE HELP! i need to press buttons alternately to make the person move, but when
    i try i can hold both and he’ll go really fast.
    if you hold 1 it doesnt move. you want code
    here:
    onClipEvent (enterFrame) {
    if (Key.isDown(Key.LEFT) && this._currentframe == 1) {
    _root.BallOneMin._y -= 1;
    _root.BallOneMax.play();
    _root.BallOneMin.nextFrame();
    } else {
    if (Key.isDown(Key.RIGHT) && this._currentframe == 2) {
    _root.BallOneMin._y -= 1;
    _root.BallOneMax.play();
    _root.BallOneMin.prevFrame();
    }
    }
    }

  • Joshua threlfall

    for some reason when i try to place turret in above movies it only lets me place it in cant build area.

  • Matt

    Great tutorial! Your coming out with new stuff almost every day. How do you manage to write so many a tutorials in such a short time?

  • Emanuele Feronato

    I quit sleeping a year ago

  • shiv1411

    hi,
    gr8 tutorial Emanuele.
    Anyways, i completed 5 levels of the game I am going to submit in MochiAds contest. I am planning to make 5 more levels. Shall I send u the complete game too? Whats ur email?

    • nyj

      can u send to me ur works in this Flash TD tut because i have some problem. can un help me? sory poor english.

  • shiv1411

    hi Emanuele,
    Please make the next part of the claustrophobic SURVIVAL HORROR tut.

  • Frederik J

    Emanuele, as always, nice tutorials. To you, it’s just some words, but to us, it’s something… something livechanging. – You help us so much, another time: thank YOU! :)
    /Frederik J

  • David

    i have said this many times already i’ve forgotten how to count

    great tutorial

    i can’t wait for the next tutorial on “Create a Flash Racing Game Tutorial”

  • Frederik J

    David, thats not Emanuele who writes it, its GameSheep!
    /Frederik J

  • nvrr mind i fixed it =)

  • conor

    errmmm love this tut but i got a problem…

    how do ya post in user controbutions??

  • conor

    love the tutorial but i have a few quextions i need to ask…

    1. how to post new topics in user contorbutions
    2. can i post a game i made using a gamecore off my uncle and his program that i used to put it al together?

    love a ansewr soon k?
    p.s the game i made is a fps with AI and full functional action kinda like halo or doom but not as good

  • Emanuele Feronato

    You can send your works to info@emanueleferonato.com

  • GR8! M8! did u quit sleeping? lol then we request u quiting lunch and nature’s call needs to write more tuts!! plzz! ;D

    best regards

  • jabs

    Nice tut. Reminded me for a few things I need to remember to do when making mine.

  • Tosho

    Huge thanks for the tutorial!

    Been looking for something like this for along time. Can’t wait till it is finished!

  • “powered by coffee”, ay?

  • Pingback: Hoi! Koffie? » Tower “Addiction” Defense()

  • Something

    Mine never shoots! plz help

  • ok how do i run the fla filess?

  • I need help dude plleeeeaassee… Nothing works for me, the graphics don’t even show up!
    I really need help as I ALWAYS wanted to build my own tower defence game!

  • juan

    What do you need in order to make td’s of your own??? and is it free??

  • juan

    What do you need in order to make td’s of your own??? and is it free??

  • LordCrazyKing

    The problem with placing the tower is that it checks if any of the corners are on the path and because the tower is wider than the path it can be placed over the path so long as all 4 corners aren’t on the path, might want to look into that for next tutorial or fix it in this one :)

  • MJGB

    juan,

    You need to have a copy of Adobe Flash (Or Macromedia Flash) and some knowledge of Actionscript. Or, yo can follow tutorials such as those of Emanuele.

    Can’t wait for the next parts Emanuele Feronato, great blog and tutorials.

  • Jim

    What is actionscript and how do i get to it

  • Dakota

    to fix the hittest problem (the 4 corners issue), simply hittest the entire base, not just the corners. or maybe your allowed to place it over the path…

  • Padfoot02

    lol if u dont kno wut actionscript is i suggest u find a much simpler tut. (actionscript is the stuff u type in so that the funny pictures do stuff you want them to. its like a type of flash-language.)

  • Padfoot02

    also, emanuele, how do you make the rest of the whole game? or are you going to come out with a tut for that later? i didnt catch.

  • 007

    Man, real awesome tute, waiting for the final version..like in which you’ll cover the Fire rate and a much better AI

    Thanks

  • Actionscript is what this tutorial is based on retard. you have to use it to code most of the online flash Tower Defences. there is racing and also action ones like Feudalism.

  • Mark

    Wow, people are pretty rude on here sometimes and not very informative. For the people asking about this
    1st: You need Adobe Flash to make these games
    (go to adobe.com to get a 30day trial)
    2nd: Actionscript is a programming language that Adobe Flash uses.

    3rd: Hey Emanuele it’s been a long time since ive been here. Your 1st tut on a line rider game inspired me to continue learning flash when i was very doubtful in my skills. Now im thinking about making my own tutorials in flash. So keep up the good work! by the way ill send you my own tower defense game im making, not based on your tut though.

  • alderman

    Hi can you tell me how to make so that i could upgrade,build more and turn off or destroy my towers?

    Great Tutorial. Merry Christmas everyone

  • Joe

    Hi, can anyone tell me how to start making a tower defense game?
    i’d really appreciate it, thx

  • Frederik J

    Joe:
    First of all you need some basic/advanced Actionscript knowledge, if you don’t got it then look at some tutorials. You also need the program Macromedia flash 8 or MX2004 (I recommend 8), and then it is just to start developing the game. You can also follow Emanueles tutorial, that you’ve just read.

  • Joe

    I already had flash, how do i open it and start making the game?

  • Frederik J

    You just open it, make some movieclips and then start coding.. But it isn’t that simple. You need to know how you code actionscript..

  • erik

    will emanuelle launch a third part? cause i dont have the knowledge to develop the rest of the game myself

  • This is a great tutorial ! Thanks

  • TheInfinity

    i can’t open the sources =( It says unexpected file format….Anyone Help?

  • kasiaijuz

    yeah,
    i’ve got movie clips and code into actionscript window but how to make it now to work?
    help us!

  • TheInfinity

    i built up to this point but when i try it on .swf the minions disappear. Any ideas?

  • Why, when the speed is adjusted, do the minions flicker and stop in the corners?

  • mikel

    i have the same problem as you with the tower defence making. how do u fix it?

  • I’m 8 :-)

  • meee

    i put everything in place but when i try to play it it loads then sais “this script is causeing flash to run slowly. if this continues, your computer may become non responsive. do you want to abort?yes/no”
    when i click no it just waits a little and sais the same thing again. how do i fix this?

  • Jamie

    hey, this is an awesome tut but im having a problem with the creeps turning, they get to a corner, then flick back and forewards until they are all doing it on top of eachother, when they start going again on top of eachother

    here is the code as it is now (just the turning bit):

    if (new_monster == delay) {
    monsters_placed++;
    new_monster = 0;
    min = attachMovie(“minion”, “minion”+_root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:807.6, _y:252.3});
    min.point_to_reach = 0;
    min.speed = 1;
    min.onEnterFrame = function() {
    dist_x = waypoint_x[_root.min.point_to_reach]-this._x;
    dist_y = waypoint_y[_root.min.point_to_reach]-this._y;
    if ((Math.abs(dist_x)+Math.abs(dist_y))<min.speed) {
    this.point_to_reach++;
    }
    angle = Math.atan2(dist_y, dist_x);
    this._x = this._x+this.speed*Math.cos(angle);
    this._y = this._y+this.speed*Math.sin(angle);
    this._rotation = angle/Math.PI*180-90;

    Please help! thanks, Jamie

  • LUK

    Please, release part 3 of this tutorial… It`s great tutorial!

  • Danny Ocean

    i finished this doing what you said but, when i view it the minions never come. help!

  • noob

    i am very noob about making a game so where can i open this side where i can make a minion and pach

  • Luiz Filipe

    where is the end? part 3?

  • david

    i dont know how to do the lines it just shows it on my com

  • david

    click yes trust me

  • lucas

    i am very excited about making my very own tower
    defense.

  • Jesse

    Nice tutorial two questions can you speed up the speed of the bullets and is there a 3rd part to this tutorial yet

  • td

    When are you going to finish?
    I really want to make a td game!

  • td

    why did i get modded?

    • who know how to make loading in flash 5?

  • td

    btw i need help making it where you can buy bases.
    when i buy one the background turns white and i can’t place it anywhere,and if i try to buy another one it goes up in the corner.
    any help?

  • Ice_Hero

    I got a question where do i get Macromedia Flash
    and how much is it or is it free?

  • Rc

    Great tut!!!

    The thing is, I can’t play it… Kinda sad you know :(!!! Please help!!! If you know plese post to reply.

    Thanks,

    Rc

  • W00T W00T

    omg i dont got this…

  • Joar

    Thanks for the great tutorials. I’m very bussy
    making my own towerdefence, but offcourse i’m stuck now and then.

    Hope you write a 3rd part, i would really appreciate it.

  • How do you call min outside of the min.onEnterFrame= function()
    {
    }
    When I do a hitTest with _root.min inside the bullet’s onEnterFrame, it only works for the min that was most recently created. Is there a way I can program outside the min onEnterFrame and have the code work for all min’s created?

  • Cory

    O.K. i need the program to make one of these please! Thank you!

  • Pingback: L’ultima linea di difesa /4 - Faccio Cose Vedo Gente()

  • Draco18s

    I’d really like to see part 3 on this one. I downloaded the source here to expand on and make an actual game, but there are so many things right now that are controlled in actionscript on the main frame, instead of via other controls and it’s a significant amount of work splitting those off without breaking the whole thing.

    I’ve been pondering making a TD game for a while (mainly due to the fact that all the towers out there are the same, and I have a few new ideas to put to the test), but lack the knowhow to figure out how to get started. I really need some starter code and all I have to do is tweak.

  • when are you going to make the third part?? i havent got the brains to make the rest :D

  • stupid kid w/ dreams

    how the hell do you even test it? :'(

  • Mike

    Great tut. When are you going to get part 3 out?

  • Mike

    Great tut. When are you going to get part 3 out? I need some help with the firing. How do i make the bullet never miss or disapear if it leave the range of the tower?

  • i love this website i just cant find astral tower defense cause i played it 1 time and then the next day i couldnt find it.

  • PLZ MAKE A THIRD PLZ!!!!

  • jared

    according to flash u have errors in lines 4 and 18 dude

  • jared

    That was for Jamie the last one

  • MasterMind

    Dude, THIS IS AWESOME!!

    3 Q’s

    1 how do you increase the bullet speed?
    2 could you make a part 3 about how to make a building menu where u can click on the base tower (small icon) so u can place it multiple times? (and with money from creeps offcourse)
    3 could you tell me how to make waves? so 1st the triangles and after there are no triangles left, circles etc.

  • Brandon

    your joking about the non sleeping thing right???

  • yoded

    hey mastermind you can make waves by using timers between 2 waves …

    u can try to make a building menu by youreself just create some symbols whit small towers put them in a seperate space on youre frame use a release function so you can click them and copy the coding from the frame that makes you place a turret in the first place …

  • how do i ga the games maker wats it called and where do i download it???

  • Put this on the frame, and make the mc “ball”

    /*
    -Put this on the frame
    -Make sure the mc is named “ball”
    */
    speed=1;
    //Specifies the mc’s movement speed in pixels
    onEnterFrame = function () {
    if (!Key.isDown (Key.LEFT)) {
    l = “up”;
    }
    if (Key.isDown (Key.LEFT) && ball._currentframe == 1) {
    if (l == “up”) {
    ball._y -= speed;
    ball.gotoAndStop (2);
    }
    r=”down”
    }
    if (!Key.isDown (Key.RIGHT)) {
    r = “up”;
    }
    if (Key.isDown (Key.RIGHT) && ball._currentframe == 2) {
    if (l == “up”) {
    ball._y -= speed;
    ball.gotoAndStop (1);
    }
    l=”down”;
    }
    };

  • Rather Cheesy

    I love you and this site… Not in a homo way =P

    I haven’t been able to find tutorials like these anywhere else but here. I’m going to start work on a more in depth tower defense game after this by combining your code with codes I already know. I’ll post a link to it once its done if I can remember. ^_^

    This site is epic and I demand that it stay open for eternity!

  • Zync

    Ok Emanuelo this tutorial is awsome but you didn’t tell what programm did you use? please post more details because I want to enjoy making a TD game too…

  • I’m trying to load the builder but cannot. Can you help???

  • John

    I would also like to know what program you used so I also can have fun making my own TD game.

  • Hi in response to your question, “What program is he using” he is using flash. You can download a free 30 day trial from:

    http://www.adobe.com/products/flash/

    Check out my site –

    http://www.kongregate.com/accounts/cleverclogs

    Cleverclogs =)

  • Pingback: digitalt skapande » Tower Defence()

  • Scott

    im so confused

  • Zackorith

    how to make you lose lives if they get to middle!?

  • help

    what program do you use

  • Eric

    Please make a part 3 including:

    -Waves, or levels, of enemies.
    -How to create more towers by clicking and dragging from an icon of that tower.
    -Incorperate money, enemy health, and lives.
    -The ability to select a tower and see its stats.

    Thanks! Awesome tutorial!!

  • armoured soul

    ok im new to flash and i put the actions script in and made each symbol in a movie clip exaclty how the tutorial shows im just wondering if anything needs to be on the stage? all i have is the path and nothing is happening and when i drag the minions on nothing happens. any help would be greatly appreciated.

  • bud

    help plz not workin

  • i want the next part

  • whens the next one comming out?

  • oliver_l1

    Wow! Really amazing. Please make a third part if possible.

  • i have an idea for a flash elemet 3 but i really really think it should go to more then just the computer ….. mabey have a chance on systems like the ds or wii or something that would be awsome.

  • please make a third part if possible.

  • I wish i could make a game as cool as urs

  • yes who ever made this definitely should make a part 3 but add lots more towers and enemies so it blows us away

  • td

    how do start making it

  • td

    how do start making it in what place

  • markus

    hi, nice work dude. i really want to make a TD game. but i’m not sure how to do :S. u can e-mail me if u want. cya around :D

  • markus

    oh btw, i have made some changes on the suff u did. if your intrested mail me and ill send it to ya. that TD i made would rock if i got it nice and ready “/

  • bl3h

    markus teach me pls..

  • random

    ok dude go take a week long nap and then make a part 3.also if any body is proficient in flash/actionsctirpt and wants to work together on a game contact me at electricbrock@gmail.com

  • hey go play new game of mine (way cool)

  • dylmani555

    Does anyone know where i can get free online actionscript lessons cos me and my mates really want to make this HUGE flash game where you basicaly live out your life a bit like sims but bigger goryer and better graphics

  • marre2795

    I can’t open it because it is an unexpected file format

  • Gamerz

    Can you get a grid for Macromedia Flash MX? And my syntax doesnt work very well… Tips? Comments?

  • Hey Emanuele,
    I had to make a Tower Defence game for school lately and I based on your tutorial here to create it – though I had to write it AS3, so I actualy had to think a little myself :)
    My game is embedded in Facebook, it uses pictures of your contacts there. You can see it here: http://apps.facebook.com/cliqster/index.php?vis=towerdefence (if you don’t see the game try looking for it on the lower right corner).
    So thanks :) and enjoy.

  • did you really quit sleeping?

  • i don’t know how to anything.Do you know how?

  • I have NO idea.

  • Are you new to flash? You should use a flash program 6, 7, or, 8. you simply copy the programming and place it into “frame actions” which can be acessed by right clicking a frame and selecting “actions” from the list. you then past the code into the box and there you go. The programming also requires you to name the things in the library the same as in this tutorial otherwise it won’t work. You can also modify the actionscript so you can make up your own names. you also need the same path or again modify the
    waypoint_x = new Array (modify the numbers) and do the same thing with “waypoint_y” You can find the coordinates through “mouse coordinates” by going to windows at the top, selecting panels and selecting info from that.

  • Ben

    Hi im new here and im wondering where to put this stuff in? Also i don’t even kno wat the program is, wat is the program to make these and where do u paste it!

    Cheers plz reply

    My email to tell me: battleonkid1@hotmail.com

  • name

    i need a free(not free so many-day trial)action script program for windows xp professional.

  • ok

    ok, but how do you do this with macromedia flash 8? i am a total begginer.

  • iK

    Hey I just stumbled across this. I found this ver insightful and my AI works and more. However the isse I am having is getting my characters to Steers around corners and not the zig-zag effect. Any pointers.

    You ActionScript logic is very nice thanks.

  • anonamus responder

    that looks complicated!!!!!!!!!!!!!!!

  • How can I make it work with a lot of towers?

  • Pingback: Adobe Flash CS3- AS3 and AS2 game tutorials roundup | Lemlinh.com()

  • Alexius Lengele

    I’m making a similar game for a class of mine and I was wondering if you had any tips to make it simple but still work nicely…

  • Vishal

    Hey i am trying to make a TD game like this for a project but am confused please can you help me?

  • cody

    wat program to make one of these?

  • Josh

    come on schools started again and you still havnt updated this tut lol its my fav so i would really like a better turret ai or a link to a site with a good script for it im kinda stuck right now

  • Smurf

    I’ve been using this instead of the ‘hitTest’ of the bullet

    if (bullet._x this._x-10 && bullet._y > this._y-10 && bullet._y < this._y+10){
    firing = false;
    bullet.removeMovieClip();
    this.removeMovieClip();
    }

    so it makes it somewhat easier for the tower to actually hit a monster :P

  • emil

    hey what program do u use you didnt say that…

  • emil

    how do i play it when i opened it with macromedia flash pro?

  • Didds

    @Smurf

    Your code doesn’t work

  • Hi,

    I can’t find the software to use this code.
    PLEASE HELP

  • george

    ok……
    what program do u use to make a td game like this???

  • DudewithKnivesinhisPants

    You guys asking what program to use, you are all morons.
    “Make a –>FLASHFLASH<– Element Tower Defence – Part 2”

    The clue is there, in the NAME!
    learn to read before posting retarded comments.

    Jees.

    Nice tut man, can’t wait for part three! ;)

  • Just to let people know I’ve been build a tutorial series like this off my blog – I will encompass all the items covered here and then some. Stop on by!

    http://walterreid.com

    The link to the flash is off my front page or can be searched with the keywords “How to build a tower defense flash game”

  • i don’t now how to make a game can you tach me how to make a game

  • When is part 3 comming out?

  • uughhh need part 3…

  • Rasputen

    I modified the code to place multiple towers and to allow the towers to fire on a delay counter instead of waiting until the bullet is removed to fire another. I have used the same variables names with the suffix “Array”. Now, I am stuck on the direction. I can’t find a way to set the direction so that different bullets aren’t all updated to travel at the same angle. I tried using the direction as it’s own array, but can’t set the ID in the bullet.OnEnterFrame function.

    Actually in most of my current projects, I have that problem. How do I have an onEnterFrame function recognize a value only intended for one instance of that function. Can anyone please help me out? I would really appreciate it. I am exhausted from all the Tutorials and forums in hunt of this.

    (sorry for the long post, now lets hope everything paste correctly) here’s the code

    for (i=0;i<towerArray.length;i++)
    {
    firingArray[i] -= 1;
    if (placedArray[i])
    {
    distance_from_turret_x = towerArray[i]._x-this._x;
    distance_from_turret_y = towerArray[i]._y-this._y;
    if ((Math.sqrt(distance_from_turret_x*distance_from_turret_x+distance_from_turret_y*distance_from_turret_y)<base_range/2) and (firingArray[i] <= 0))
    {
    firingArray[i] = firingDelay;
    bullet = attachMovie(“bullet”, “bullet”+_root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:towerArray[i]._x, _y:towerArray[i]._y});
    bulletArray.push(bullet);
    bullet.dir = Math.atan2(distance_from_turret_y, distance_from_turret_x);//here(?)

    }

    }

    bullet.onEnterFrame = function()
    {
    this._x -= 1*Math.cos(bullet.dir);//here(?)
    this._y -= 1*Math.sin(bullet.dir);//here(?)
    if ((this._x<0) or (this._y400) or (this._x>500))
    {
    this.removeMovieClip();
    }
    };

  • rasputen

    I fixed the above code by changing bullet.dir to this.dir but it only works when the bullet.onEnterFrame is embedded in the main onEnterFrame function. Any help?

  • Bryce

    how do u do this i cant get to the part where u make a road or minions??????????????????

  • mat

    thx a lot man what do you need do download and where from

  • a new TD and i hope you like it

  • Nyny

    What language is used for this TD game?

  • Make

    PART 3!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • Kat

    Another person begging for a part three… Also, if you could clear up a couple things. The range and base both line up the top left corner instead of the middle, how do I fix this? And for the cant_build, do you draw that out in flash or use an imported image of the path? I tried importing the path I was using but it comes out as a rectangle. Is there a way to set it to ignore the transparent parts or do I just have to draw it out in Flash? (I’m using .png files for graphics.)

    Last question for now… Know of any books or websites that could give me a good introduction to actionscript? I’m already reading everything I can get my hands on, but it’s difficult to find references for beginners, and a lot of the basics are geared towards presentations or web design rather than games.

  • Pingback: Flash Tower Defence Prototype v 0.9 | Its Not Another Gaming Site()

  • Hi guys,

    I have been waiting for part 3 for a long time too, but anyways I decided to play around with the source file Emanuele’s given here and came up with an almost complete prototype.
    You can check it out here
    http://www.itsnags.com/archives/240
    It features multiple towers
    Multiple waves of monsters
    Monsters getting tougher on each wave

    I need some more time to complete it and then I’ll be posting a tutorial.
    Thanks to Emanuele for his wonderful post!

  • Newbie

    I’ve tried to let the bullet (an arrow) rotate to the minion.
    But I couldn’t figure out how.
    please help

  • Please make a part 3 so people like me (really beginner at flash) can finish the game. Some good ideas would be money system, upgradable towers, selling towers, different types of towers.

    Thanks for the Tutorial!

  • Jjjet42

    I though i’d let everyone know that i know a better tutorial for this. Just search for
    Walter Reid Tower Defence tutorial.

  • This is amazing. I am a tower defence creator but I only do it on paper and on Microsoft PowerPoint. there is 1 question.
    What progran do you use?
    Thanks.
    And come on my website!

    Http//:www.freewebs.com/Clubarv/

  • Hey also I want a part 3!

    Please

    Ap

  • Unknown

    Apensea – Adobe Flash. Assuming that you aren’t a teacher or a student, it would cost about $750 to buy the program.

  • Jon

    Hey im just wondering (im kinda new to this) would Adobe Flash Player 10 be a reliable program to build Tower Defense games? Thanks

  • bob

    suuup freakin sweet tuts but like wat program you use?? i kno it says Flash but can you email me a more specific thing? and maybe give me a link to where i can get it? plzzzzzz

  • bob
  • i need help. i downloaded this thing and now i havent the slightest clue wat to do now. i dont even have a screen or anything just the thing is downloaded. this thing really doesnt explain that much at all, like wat to do RIGHT after it just assumes u know.

  • NEAR

    Just wanan say this is a great site, me and my friends are forming a programming team and Walter Reid, your site is very helpfu!

    So I have this idea, in order to make the firing rate quicker, we need bullets fast, no? so how about a command that says “hey, you, bullet, yeah you, when you go outside the firing range, leav the clip so we can sand another one of our boys!” unfortunately I don’t know how to do this, but I have a theory:

    if(_root.bullet. hitTest_range = false, remove clip)

    sometihng like that….
    Also, for bullet speed, stick this in somewhere

    bullet.speed = 0;

    tweak these a bit and you may come up with sometihng good, if you really needed this and it helped you, I’m happy to help!

  • Chris

    Can you please finsh the tutorial and show us how to make weapons and make them fire.

  • This is wonderful i am loving it.

  • dani

    oigan yo tengo el flash 5 y puedo crear juegos pero me salen mal los de plataforma y tower defence

  • Wow, cool tutorial :D

  • Great tutorial but a simple game. I would like to see something more advanced :)

  • nino

    i want to make so bad thanks but this is my moms work computer so i cant download stuff thanks any way

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

  • Pingback: marciorosa.org » Make a Flash game like Flash Element Tower Defense – Part 2 - Complete listing Tools and resorces for the ultimate web developer()

  • KiviBot

    This script has a glich:
    you can place that tower to path

  • SeVeReD ZaLeN

    u need 2 make a third tut!!!!!!!!!!!!!!!!!!!!!!!!!
    plz

  • i dont really understand how to use the scripts, do you have a program i can download or, do you do something else… please respond :D

  • Dave

    Hello,
    Why if I put the speeds higher, the minions will crash in the corners, how can i help that?

  • Jopz

    you should atleast finish a game if you start doing tutorials for it right? its been a long time, you should finish this ~__~

  • nyj_25

    sir can u help me? in this tut. i cant get the script. this my email nyj_25@yahoo.com

  • good tutorial. i’m going to create a great game using this..Thanks

  • Mike Hunt

    This is a great tutorial. I told my friend Ben Dover to have a go at this. He thought it was great too. Thanks again for your great tutorial.

  • Brendon Ray

    First i would like to thank you for all the work you do. I am currently working on a project for school and I am trying to make a tower defence game. The problem is I cant find any code for actionscript that allows me to make the tower shoot at a specific target or allow the user to choose the tower’s primary target (first, last, least health, etc.) Also I am having trouble finding out how to make a money system, life system, and how to give enemies stats like health and speed.

  • gavin

    ok im probably an idiot for even trying to make something like this but where do you get all the codes for these games. I am just trying to make one to see what its like but it likes mostly like random words. If anyone could tell me where to go to find it that would be great

  • xxxxxxxxxxxxxxxxxx

    It doesn’t work. all i get is the damn minions but no tower

  • Man,you game sucks.cuz there is only one turret and no game overs or wins or
    money or upgrading………….

  • r4

    it works well.and i can make my flash game now

  • boblta

    @KiviBot it doesnt

  • Man you got awesome stuff! But fire rate is a thumb down, and so is what the bace fires at.

  • Carl ‘Nith’

    Greetings, I love your tutorial, but I got one problem. Just to mention, I am a huge noob, however…
    What if I’ve put a code together in notepad++, how do I make into like a launcher that will open the game or thing I coded?

    Would be very glad if someone respond :)

  • Coudray

    @carl nith

    You need to have an Adobe Flash player (currently there are 5.5 and 6.0 version out there)to have this code executed, you can work it in notepad ++ but you need the application.

    From the looks of the codes, it uses an ActionScript 2.0 since it’s very outdated but you can use them inside the ActionScript 3.0 anyway.