enemy creation as2

Random Movement & Random Direction Change

Sunday, January 11th, 2009 | Enemy AI, Game Examples AS2 | 1 Comment

Here is an ActionScript 2 enemy ai script that allows you to create enemies that move around randomly inside a container movieclip and randomly change direction.

Preview

Download Fla Sample

Download Fla Sample

Tags: , , , , , , , , , , , ,

Game Enemy AI - Random Enemy Movement

Saturday, August 30th, 2008 | Enemy AI, Game Examples AS2 | No Comments

Flash ActionScript 2 game enemy AI. This game engine creates a preset amount of enemies, gives enemies stats, and makes them move around randomly.  AS2 code example available for download below.

You can set enemy behavior like:

  • Roam Speed - Speed at which the enemy travels
  • Roam Time - How long to move before changing direction
  • Roam Distance - How many pixels to travel

Also check out the Game Enemy AI - Follow Player script.

ActionScript Enemy AI Example

Download Fla Sample

Download Fla Sample

Note 10/30/08:
Updated script to fix an error. Current version is 1.1.

Tags: , , , , , , , , , , , ,