Free ActionScript

Home

AS3 Scripts

AS2 Scripts

Resources

About

Contact

Flash ActionScript 2 game enemy AI. This script gives your enemies the ability to follow the player.

Download Fla Sample

Customizable Enemy Settings

movement speed

turn rate

aggression range

Update Check out the updated version of this script that incorporates different enemy behaviors in to one function, as well as creating multiple enemies at the same time: Enemy Behavior – Run Away & Follow Player

I really found this fla useful but I’m a little stuck. I want to make more than one of these enemies but when I do that, only one of them follows. I am duplicating the enemy and putting it on stage at random.

Hi Werty2334, upload your fla somewhere, I’ll take a look.

I could use another one of these which explains how to get more than one too, it all works perfectly up-til you want more than one… could the enemy code be put in his own movieclip? thats what i was using before but now i want him to point at me too.

Thanks in advance

Hi Catalyst,

Check out http://www.freeactionscript.com/2009/04/enemy-behavior-run-away-follow-player/

There’s a good article on how AI works on http://www.scratchpad-cloud.com/blogs.htm

It’s not specific in detail for Flash, but gives you a good theory on how it works for any beginner games programmers out there.

You must be logged in to post a comment.

AS3 Effects

AS3 Gadgets

Game Examples AS2 Effects Animated Effects Dynamic Enemy AI Game Engine Game Weapons Images Interface Math Security

Effects Animated

Effects Dynamic

Enemy AI

Game Engine

Game Weapons

Images

Interface

Math

Security

Game Examples AS3 Basics Bitmap Blitting Collision Detection Enemy AI Movement Physics Space Shooter User Interface Weapon System

Basics

Bitmap Blitting

Collision Detection

Movement

Physics

Space Shooter

User Interface

Weapon System

Site Updates

718Hosting.com

Actionscript.org Forums

Flash Game Blogs

Flash Game License

Flashkit Forums

gotoAndLearn

IndieGames.com

Kirupa’s Tutorials

Kongregate Forums

MochiAds Resources

Philip Radvan

Photon Storm

Polygonal

Radvan Media

Tonypa’s Tutorials

Register

Log in

Entries RSS

Comments RSS

WordPress.org