# Space Invaders problem

**URL:** <https://forum.kirupa.com/t/space-invaders-problem/82108>\
**Category:** Uncategorized\
**Created:** [March 7, 2005, 8:51pm UTC](https://forum.kirupa.com/t/space-invaders-problem/82108 "2005-03-07T20:51:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![patmul](https://avatars.discourse-cdn.com/v4/letter/p/ee59a6/32.png) [@patmul](https://forum.kirupa.com/u/patmul)\
**Post date:** [March 7, 2005, 8:51pm UTC](https://forum.kirupa.com/t/space-invaders-problem/82108/1 "2005-03-07T20:51:41Z")

</div>

**Space Invaders problem**  
Doing a project in flash at the minute in Space Invaders but don’t really know too much about flash mx. The problem I have is that when i shoot the attackers from my ship they’re not blowing up and I don’t know how the code to do this .My code at the minute for shooting is  
onClipEvent(load){

moveSpeed=10;

}  
onClipEvent (enterFrame) {

if (Key.isDown(Key.RIGHT)) {  
this.\_x+=moveSpeed;  
} else if (Key.isDown(Key.LEFT)) {  
this.\_x-=moveSpeed;  
}  
}

// when the mouse cliks  
onClipEvent(mouseDown)  
{  
// duplicate the bullet mc  
\_root.bullet.duplicateMovieClip(“bullet” + bulletNum,bulletNum);  
// set the coords to the mouse clik  
eval("\_root.bullet" + bulletNum).\_x = this.\_x;  
eval("\_root.bullet" + bulletNum).\_y = this.\_y;  
// increment the bullet number  
bulletNum++;  
// if more than 50 bullets , start again at 0  
if(bulletNum\>50)  
bulletNum = 0;  
}

and for the attacker is  
onClipEvent(load){  
this.\_y =0;  
speed=10;  
}  
onClipEvent(enterFrame){  
if(this.\_x \<0)  
{  
// set direction to right  
speed=10;  
// drop down  
this.\_y +=30;  
}  
if(this.\_x \> Stage.width)  
{  
// set direction to left  
speed=-10;  
// drop down  
this.\_y += 30;  
}  
// move horizontal  
this.\_x += speed;

}

If anyone could help me with some of the code I would much appreciate it
