I'm trying to create a top down melee combat system and I keep getting stuck on the swing. I want the player to hold the left mouse button down to swing the weapon. While the button is held down, the weapon has a back swing, then once that angle is reached, it is swung forward until it reaches the end of its forward swing. Since it's top down, the player sprite could be rotating (player sprite always points at the mouse) as well, which should affect the angle at which the weapon is held. Ex: if the player sprite rotates the same direction the weapon is being swung, the weapon should appear to be swung at a higher speed, or vice versa.
I also have several different melee weapons, each of which has a different back swing, forward swing, swing speed, etc, and I have them all in a family. I'm trying to use a function that just uses the instance variables to determine the actual angles.
I've been working on this for a few days now and read all the threads I could find on melee combat, but those are all about animation frames, which I'm not using.
Imagine Hotline Miami's melee, except the mouse button needs to be held down throughout the swing or else the weapon goes back to its default position.