|
-
Senior Member
Hmmm, let's see... place something like this in the bullet movie clip:
OnClipEvent(enterframe)
{
if (key.isDown(key.SHIFT) && shooting == 0){
this._x = _root.player._x;
this._y = _root.player._y;
shooting = 1;
}
if (shooting == 1){
this._x = this._x + 10;
}
if (this._x > 600){
shooting = 0;
}
this code shoots a bullet to the right, and there can only be one bullet on screen at a time. If you want to have several bullets, use duplicateMovieClip, and removeMovieClip to remove the bullet when it is offscreen.
hope this was helpful,
Olorin
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|