Since your Bullet is moving, I'm assuming you've put in an element of speed. So lets see here:
Code:
vel = the speed you want the bullet to travel
if it's going:
Code:
UP
speedY = -vel;
speedX = 0;
DOWN
speedY = vel;
speedX = 0;
LEFT
speedY = 0;
speedX = -vel;
RIGHT
speedY = 0;
speedX = vel;
and so on and so forth (I hope you don't need me to explain the other 4 directions)
So, all you need to do is get the direction the man is facing:
Code:
function getFacing(){
you should be able to
figure something out
here, otherwise just email
me, or just say so.
return x, y; /*tell us whether x is going to be positive,
negative or zero, and do the same for y. That should send
our projectiles in the right direction.
*/
}
Now that you know which direction the man is facing, you should know what the x and y components of speed are going to be (in other words, is the bullet going left, right or neither. Is it going up, down or neither).
Now all you need to do is shoot the bullet in that direction e.g.
Actions for an MC named bullet_034, where vel = 5 or whatever, and the man is facing LEFT:
Code:
onClipEvent(load){//You don't really need this onClipEvent(load).
speedX = -vel;//When you create your bullet using attachMovie(),
speedY = 0;//You can tell it these properties anyways.
}
onClipEvent(enterFrame){
this._x += speedX;
this._y += speedY;
}
Hope this helps.