PDA

View Full Version : [AS2] Heat Seeking Missiles/Rockets/Torpedoes


pradvan
12-16-2008, 06:31 PM
This is a 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.

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


Screenshot
http://www.freeactionscript.com/download/screenshot/game-shooting-missiles-rockets-torpedoes.jpg

Preview & Fla Download
http://www.freeactionscript.com/2008/12/weapons-heat-seeking-missilesrocketstorpedoes/

Feedback
Any comments, suggestions, questions or bug reports are welcome!

EightySeven
12-16-2008, 06:51 PM
Pav I love your site. Provides great inspiration and guidelines for AS3 code since I don't really know AS2.

keep up the amazing work

pradvan
01-07-2009, 09:19 PM
Thanks 87!

AS3 is coming soon, i promise! :)

CyanBlue
01-07-2009, 09:51 PM
Looking very nice... ;)

One glitch that I have noticed is that it seems like a missile assigns a target when you fire one, then go pass the target that is in the way... For example, you create a target at 12 o'clock location, a missile gets created... Create another target in between the target and the missile... The existing missle go through the target where it should be really destroying whatever is in the way unless it is 3D world... ;)

pradvan
01-07-2009, 10:00 PM
Thanks CyanBlue.

The glitch you describe is not really a glitch but a "hack" I used to give missiles targets.

Currently there is no enemy manager and no missile target manager. As soon as you fire, the missile locks on to the enemy that you create as you fire.

In a real world scenario the missiles should hit whatever is closest to them. But I think that this is way out of scope for this example.

:p

CyanBlue
01-07-2009, 10:08 PM
Sounds fine to me... ;)