I gots another problem with the fire now. I want to limit the number of times you can fire in a row. Right now I have this code:
Code:
if (Key.isDown(Key.SPACE)){
laserCounter++;
_root.laser.duplicateMovieClip( "laser"+laserCounter, laserCounter );
_root["laser"+laserCounter]._visible=true;
playsound = new Sound(this);
playsound.attachSound("laser");
playsound.start(0, 1);
m--;
}
I tried this:
Code:
if (Key.isDown(Key.SPACE)){
m=1;
while(m<5){
laserCounter++;
_root.laser.duplicateMovieClip( "laser"+laserCounter, laserCounter );
_root["laser"+laserCounter]._visible=true;
playsound = new Sound(this);
playsound.attachSound("laser");
playsound.start(0, 1);
m--;
}
}
But that just jams up my computer, what am I doing wrong. I thought my change would limit it to 5 shots at a time.
Bookmarks