im making a sidescroller..and my common sense isn't that good i suppose...heres the code
onClipEvent(load){
speed = 10;
shotnum = 10;
shotmin = 10;
shotmax = 20;
reload = 8;
nextshot = 0;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
_x -= speed;
}
if (Key.isDown(Key.RIGHT)) {
_x += speed;
}
if (Key.isDown(Key.UP)) {
_y -= speed;
}
if (Key.isDown(Key.DOWN)) {
_y += speed;
}
if (Key.isDown(Key.SPACE)) {
if (nextshot == 0) {
nextshot = reload;
shotnum++;
_root.shot.duplicateMovieClip("shot"+shotnum, shotnum);
_root["shot"+shotnum]._x = this._x;
_root["shot"+shotnum]._y = this._y;
}
}
if (nextshot>0) {
nextshot--;
}
if (shotnum>=shotmax) {
shotnum = shotmin;
}
}