# Enemies disappear randomly

**URL:** <https://forum.kirupa.com/t/enemies-disappear-randomly/235637>\
**Category:** programming\
**Created:** [August 13, 2007, 4:57pm UTC](https://forum.kirupa.com/t/enemies-disappear-randomly/235637 "2007-08-13T16:57:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![leetleet](https://avatars.discourse-cdn.com/v4/letter/l/41988e/32.png) [@leetleet](https://forum.kirupa.com/u/leetleet)\
**Post date:** [August 13, 2007, 4:57pm UTC](https://forum.kirupa.com/t/enemies-disappear-randomly/235637/1 "2007-08-13T16:57:28Z")

</div>

One the first frame of ‘enemyOne’ movieclip, I have:

```auto

var o = 0;
var i = 0;
var j = 0;
function enemyOneShoot () {
 initObject = new Object();
 initObject._x = _x;
 initObject._y = _y;
 var aim = Math.atan2(_root.tank._y - initObject._y, _root.tank._x - initObject._x) * 180 / Math.PI + 90;
 oh++;
 initObject._rotation = aim;
 _root.attachMovie("enemyOnebullet","enemyOnebullet"+o,o,initObject);
};
function shootinterval() {
 setInterval(enemyOneShoot,1000);
};
shootinterval();

```

The problem is… some of the enemies randomly disappear when i click the mouse, or ‘enemyOne’ movieclip doesn’t go to frame 2 and is just gone, and some are just working fine. What’s going on?
