_Note: Fixed a problem with Part 8 download it should now be working - Thanks MIV for pointing that out._
We are now at Part 8! You should be pretty up on your tower defense games at this point in the series. However, before we begin you should make sure you have reviewed the previous tutorials if you came here directly from a link. If this is the first time you’re viewing the page you may want to start at the beginning by clicking here or you can go to the previous tutorial Part 7 by clicking the below link:
How to build a tower defense flash game – Part 7 - Gold and Upgrades!
Once again all the source code for this tutorial can be downloaded by clicking here
Ok, so this is the meat and potatoes that handles the “poison” functionality. We need to dole out damage consistently for a period of time. To do this properly, I’ve decided to have just a time that runs for the express purpose of doing “creep events”. This doesn’t just mean poison, but it works for my purposes now. So we setup a timer for the given function.
- _root["creepEventInterval"] = setInterval(_root, “creepEvent”, 500);
This just runs the function “creepEvent” every 1/2 second continuously until the game ends -
![]() |
The “fire” function is now changed:
- function fire(from, to, speed, acc, maxspeed, projectile, damage, splash, slow, poison);
We’ve included a “poison” parameter which acts as the % amount to deduct from enemies help have 1/2 second. The change is are relatively simple - The first one just asking - if the projectile that hit the enemy creep has the poison parameter set the poison attribute to the creep.
![]() |
and later in the same “fire” function and given out when a tower causes splash damage.
![]() |
We want the poison damage we set to be set by the distance from one enemy to another - so if they are far enough away the poison they take is less.
Finally, the last thing we set the “marker” movie clip to contain a clause that once we click on a “valid” spot of the green area and place a tower, we finally call the “newLevel” function and start the creeps moving and remove the instruction screen.
![]() |
So we close yet another chapter - We have covered a bunch of new subjects and improved what towers can now do. We can now interchange some new towers - splash, poison and slow. We’ve only concentrated on the specific types of towers, but the true power comes from mixing them together.
Think of it a tower with poison/high damage/small range/splash! Wow, I can’t wait to start really making stuff now! You can now move on to How to build a tower defense flash game – Part 9 - Scores and Wave Timeline!
Or you can click here to go back to the introduction




