Top Down Melee Weapon Swing

Get help using Construct 2

Post » Sat Jul 11, 2015 7:21 pm

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.
B
11
S
2
G
1
Posts: 79
Reputation: 842

Post » Sat Jul 11, 2015 7:46 pm

Although this is not a direct answer to your question, it does have an angle follow and angle set compared to the base object..
You might be able to turn this into what you are looking for..

https://dl.dropboxusercontent.com/u/485 ... ollow.capx
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Jul 11, 2015 10:41 pm

So the global variable C basically just records the angle of B in comparison to A, so even though they aren't pinned at position and angle, B stays rotated the same in relation to A?

So if I had a variable that just held the angle different between the weapon and the player, the weapon would look like it's being steadily held by the player even with being pinned at the angle.

Thank you, LittleStain. I think that solves one problem for me.
B
11
S
2
G
1
Posts: 79
Reputation: 842


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests