I am trying to make a game in which you command a sniper to shoot zombies. u command them by moving ur mouse over the enemies. BUT THERE IS A FAT PROBLEM.
onClipEvent (enterFrame) {
var numEnemy = 100
for(var i=1; i<=numEnemy ;i++){
if (this.hitTest(_root[“enemy”+i])) {
this._x = _root["enemy"+i]._x - 5
this._y = _root["enemy"+i]._y - 5
this.play();
_root.sniperReady = 1
} else {
_root.sniperReady = 0
}
}
}
The last part with the } else { command is screwing stuff up. sniperReady is ALWAYS 0 instead of being 1 when enemy is pointed at and then 0 when u r not pointing at an enemy. I am pretty sure it has something to do with the fact that the zombies duplicate I.E. _root[“enemy”+i] thingy.
PLEASE HELP HOMIESZZZZ