I have this player, who aims his weapons according to the position of the mouse. I made a couple of frames that show the guy at first with the gun pointed down, then each frame he rotates the gun up. So my code looks like this
<code
onClipEvent(enterFrame) {
if (mouseY < player.gun.y) {
player.gun.nextFrame;
}
if (mouseY > player.gun.y) {
player.gun.prevFrame;
}
}
>
so that works perfectly fine, now the problem is when the mouse clicks, i want it to shoot a bullet, the bullet is going to have to be rotated at a certain angle, and be going a certain direction for each different way the gun can be pointed. Is there a general way to make it do that? Or will i have to map out the coordinates and rotation with each frame through trial and error? I really don't want to do that since theres about ten frames in a gun, and I have about nine guns....