I seem to have a slight problem in this small part of my class. I omitted the rest because it all works fine, and I’m sure it’s not part of the problem.
I have three instances of this class, enemy7,8,9,10. Enemy 7 just sits there and does nothing, while 8,9, and ten all activate at the same time…
dynamic class enemyPlane extends MovieClip {
public var flightSpeed:Number;
public var speed:Number;
public var fallSpeed:Number;
public var smokePoint:Number;
public var conSpeed:Number;
public var active:Boolean;
public var startPos:Number;
public var i:Number;
public var k:Number;
public function rotation2D(r) {
return r*180/Math.PI;
}
public function onLoad() {
this.swapDepths(this._x+30000);
//Variables
startPos = _x;
this.life = 25;
flightSpeed = 14;
speed = 0;
smokePoint = -55;
conSpeed = -3;
active = false;
i = 0;
k = 0;
fallSpeed = 0;
}
function onEnterFrame() {
//Flight control
speed += flightSpeed;
//Activate plane when player near
if (_root.ground0._x-startPos<3000 & this.active == false) {
speed = 0;
} else {
active = true;
}
this._x = startPos+_root.landMove+speed;