I just want to do the simple press space and he shoots bullets thing. I have always done it where the codes will be in the guy and bullet movieclips. I recently learned to write codes on the main timeline. Right now the problem is when I press space, the visual bullet appears but it doesn't move up.
PHP Code:
bulletcounter=1;
player_bullet._visible=false;
player_bullet._x=player._x;
player_bullet._y=player._y;
bullet_speed=5;
onEnterFrame = function() {
player_bullet._y-=bullet_speed;
if (key.isdown(key.space)) {
bulletcounter++;
player_bullet.duplicateMovieClip("bullet"+bulletcounter, bulletcounter);
["bullet"+bulletcounter]._visible=true;
}
}
The guy is called guy. The bullet is called player_bullet.