Free ActionScript

Flash AS2 & AS3 Tutorials, Game Code, Effects, Source Files & Sample Downloads

Game Weapons – Heat Seeking Missiles, Rockets, Torpedoes

10 Comments »

This is a Flash ActionScript 2.0 heat seeking missile script for games. Includes AS2 dynamic smoke effects & dynamic animated explosion effects. Our missiles also need something to lock on to so I added a simple enemy random movement script.

Flash Game Weapon Preview

Download Fla Sample

Download Fla Sample

Customizable Missile Settings

  • reloadSpeed – how long it takes the missile launcher to reload
  • missileSpeed – how fast the missile travels
  • turnRate – how fast the missile turns toward the target

Customizable Explosion Settings

  • explosionParticleAmount – amount of explosion particles
  • explosionDistance – explosion spread distance
  • explosionSize – size of explosion particles
  • explosionAlpha – transparency of the explosion particles

If you’re having trouble understanding how this script works, please review previously posted examples that were incorporated in to this script: Animated Explosion Effect, Simple Random Enemy Movement, Enemy Follow Player, Realistic Smoke Effect – Particle Trailer & Play Random Sound.

Check out other free Flash game weapon effects from FreeActionScript.com:

10 Responses

This is a great game development blog! Thank you for the great examples.

  • Hey, so im borrow some of your code for my very first flash game. An offshoot of Raiden X. So far ive gotten the laser and the missles shooting and the ship following my mouse and all. what i really would like help with, is that your code creates missles that always go after a set enemy. could you help me modify code where the missle would go straight, unless there is an enemy on the screen, in which case the missles would go for the closest enemy on the screen (checking only once on click) and also helping me figure out how just to check if the laser hits any one of the enemies on the screen. here is what i have so far: rhsweb.org/kheath/RaidenHxC.zip

  • thanks !!!!!!!!!!!!

  • …continued…

    Could you send me a modified code where “left click” creates and enemy, and “space bar” shoots. and the missle should track the closest enemy to it at the time. I simply cannot figure out how to keep track of all of the enemies on screen via an array, then refer to their image as to have the missile follow that instance.
    email me at imoncloudnine69@hotmail.com
    please and thank you sooo much.

    http://rhsweb.org/kheath/shoot-at-closest-one.fla

  • man thanks for all of this! you shoudl put more ads on this site!!! im sure you will get tons of hits soon!!! THANKS :D

  • John: Thank you very much!

    imoncloudnine69: I actually need to write a “get closest enemy” function for my own game. I haven’t really given it much thought but it has been tickling my brain I’ll try to get around to it sometime this week and will look at your fla as well.

    cicla: Gaming has been my passion for the longest time, and making my own games, or at least making game effects, engines, etc, really does give me pleasure.

    I added a couple of google ads to help cover the hosting costs. However, I don’t plan on adding more ads as they can get annoying as hell. I don’t want to have “one of those” sites.

    -PR

  • this is so cool! but does this have an AS3 version? i recently learned AS3 and know nothing about AS2.. i am making my second game right now in AS3 and it would be cool if there was an AS3 version of this…

    P.S. the heat-seeking missile and the smoke effect really make this cool!

  • Could you please please please please make this in AS3 version. Thanks in advance.

  • Hi admin!
    I love this blog. This helps me alot in alot of game development.
    I want to make request for a code.
    In this code Gun is face the mouse all the time. So the missile always starts from a rotation to the target. and then it turns when target moves.
    I want that, the missile always starts from rotation = 0
    And have to take turn to reach the target.
    Thanks.

  • Leave a Reply

    You must be logged in to post a comment.