Okay, so I’m making a game in which you need to dodge enemies. I have this code on a movieclip:
onClipEvent (load) {
var t:MovieClip;
}
onClipEvent (enterFrame) {
if (_root.enetimer<0) {
_root.enetimer = random (200)
n = root.getNextHighestDepth();
t = attachMovie(“enemy”,"enemy"+n,n);
t._x = random (300) + 100
t.y = random (500)
}
}
onClipEvent (enterFrame) {
t._y -= 10
_root.enetimer = _root.enetimer – 5
}
The code is supposed to make a new enemy appear whenever the variable “enetimer” reaches zero. Instead, there is only one enemy onscreen and it moves around whenever “enetimer” reaches zero. I’m sure I’m missing the part of the code that makes multiple enemies, but I don’t know what it is. Can someone help?