Game Development Reference
In-Depth Information
It's now time to make the swarm move. Open the ControlSwarm script.
1. In the upper section of the script, where we declared the alien GameOb-
jects , add the following lines to create new variables:
//this is an array to store the instances
of the aliens
//that are part of the swarm
static var enemyList=new Array();
//we use this boolean to check the actual
direction of the
//swarm
var goRight:boolean;
//with this int value we define the
horizontal speed of the
//swarm
var vel:int;
//we use this boolean to control the
collision of the
//aliens with the Bounds
static var bCollide:boolean;
Search WWH ::




Custom Search