ia与机游
2010-01-31 15:35 宝宝合凤凰 阅读(198) 评论(0) 编辑 收藏 举报You are reading AS3 Flash Games for Beginners Read more from this series of articles.
- AS3 Flash Games for Beginners: Adding Library Objects to Stage with AS3
- AS3 Flash Games for Beginners: Character Movement / Handling Multiple Keypresses
- AS3 Flash Games for Beginners: More Advanced Character Movement
- AS3 Flash Games for Beginners: Level Mechanics and Animated Backgrounds
- AS3 Flash Games for Beginners: Firing Weapons with Delays
- AS3 Flash Games for Beginners: Learn How to Make Enemies with Basic AI!!!
- AS3 Flash Games for Beginners: Registering Hit Tests
- AS3 Flash Games for Beginners: Using Frame Labels and Art Tweening
- AS3 Flash Games for Beginners: Scores, HUDS, and User Interface
--------------------------------------------------------------
Enemy AI
Enemy Behavior - Run Away & Follow Player
Make your enemies alive! This Flash ActionScript 2 game enemy AI script shows you how to add different enemy behavior to multiple enemies.
Each behavior is easily customizable; you can change movement speed, turn speed, aggression range & enemy graphic for each type of enemy.
Random Movement & Random Direction Change
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
Game Enemy AI - Run Away from Player
Flash ActionScript 2 game enemy AI. This script gives your enemies the ability to run away from the player.
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
Simple Enemy Random Movement
Here is a simple AS2 enemy creation/ai script that allows you to create enemies that move about randomly inside a container movieclip. You can set custom movement boundaries/borders. When an enemy hits the border, it will “bounce off” and move in the opposite direction.
Random Movement Example
Game Enemy AI - Follow Player
Flash ActionScript 2 game enemy AI. This script gives your enemies the ability to follow the player.
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
Game Enemy AI - Random Enemy Movement
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