Flash Game Example
Target Closest Enemy MovieClip
I’ve been thinking about how targeting the closest enemy would work and started experimenting with the algorithm. Basically AS has an array method called sortOn, that sorts objects properties in any order you want. Well, that’s the catch. It only sorts objects, not movieClips.
The work around is simple enough; when creating a new enemy object, just save a reference to the movieClip on stage inside the object’s property.
Preview
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
Weapons - Shooting Projectile Bullets v1.1
This script shows you how to shoot projectile bullets from the player movieclip towards the mouse x & y position.
Easy to use game weapon engine. Flash ActionScript 2.0.
Shooting Projectile Bullets Game Example
Customizable Game Weapon Settings
- Bullet Offset - This set the accuracy of the bullet
- Bullet Life Timer - This sets the life span of the bullet based on frame rate
- Bullet Speed - This sets the speed of the bullet
- Reload Speed - This sets the reload speed of the weapon
Big Fix - 12.15.08
Fixed a bug where bullet offset was effecting the bullet starting position.
Update - 6.16.09
A new and improved version of this script is available here.
› Continue reading
CategoriesLinks |
