# Shooting

**URL:** <https://forum.kirupa.com/t/shooting/240806>\
**Category:** Uncategorized\
**Created:** [October 6, 2007, 1:06pm UTC](https://forum.kirupa.com/t/shooting/240806 "2007-10-06T13:06:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mar\_kat](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@mar\_kat](https://forum.kirupa.com/u/mar_kat)\
**Post date:** [October 6, 2007, 1:06pm UTC](https://forum.kirupa.com/t/shooting/240806/1 "2007-10-06T13:06:24Z")

</div>

i face a problem with shooting…the “for” code doesn’t run

code :  
[COLOR=darkolivegreen]//this code is writen in spear fisherman’s movie clip[/COLOR]

[COLOR=darkslateblue]onClipEvent (load) {  
\_root.spear\_mc.\_visible=false;  
shooting = false;  
positionx = 0;  
positiony = 0;  
}[/COLOR]  
[COLOR=darkslateblue][/COLOR]  
[COLOR=darkslateblue][/COLOR]  
[COLOR=darkslateblue]onClipEvent (enterFrame) {

if(Key.isDown(Key.SPACE)&&!shooting ){

```
  shooting=true;
  _root.spear_mc._x = this._x;
  _root.spear_mc._y = this._y;
  _root.spear_mc.gotoAndStop(2);
  _root.spear_mc._xscale = -100;
  _root.spear_mc._visible=true; 

```

[/COLOR]  
[COLOR=darkolivegreen]//until here the code runs right  
[/COLOR]  
[COLOR=darkslateblue]for ( positionx = \_root.spear\_mc.\_x ; positionx \< 800; positionx ++ ){  
for (positiony = \_root.spear\_mc.\_y; positiony \< 600; positiony++){  
\_root.spear\_mc.\_x += this.\_positionx;  
\_root.spear\_mc.\_y += this.\_positiony;  
}

```
    } [/COLOR]

```

[COLOR=darkslateblue] else if(Key.isDown(Key.SPACE)){  
shooting = false;

```
 } 

```

} [/COLOR]

:jail: please help!! :yoshi: thank you!
