I am curious as to how the player in[font=Verdana] [/font][font=Verdana][size=2][color=black]"Alien Hominid[/color][/size][/font][color=black]" [/color]is coded to use a subweapon at close range. The main weapon is a gun, however if you press the attack button when an enemy is at close range the main character uses a different weapon (a la Metal Slug). Any ideas as the best way to go about coding something like this?
What you could do, is when it attacks, have it check the distance between the two movieclips. Subtract the x values from each other, and then the Y values, and get the absolute value. Then, if both these numbers are say, less than 5, have it play one animation, and if it is farther than whtever distance, have it play the other animation.
You would have this all in a function that is callled when you press the attack button or something to that extent.
Great suggestion, Dan. I will have to give that a try.