Hack'n Slash combat

0 favourites
  • 6 posts
From the Asset Store
A collection of 23 amazing sprite sheet animations for your incredible games
  • So as you can see from the title I want to know how to make a bit more complex combat than what I have currently in my game.

    Basically I want something like this.

    When I press the attack button I want my guy to swing a sword (attack animation 1) and move slightly forward. And if I press again I want him so swing sword in a different direction(attack animation 2) and move forward again , and when i press it third time he swings it in some other direction (attack animation 3), and moves forward.

    It doesn't seem complicated to me but I just cant pull it off. I am still a learner so any help would be much appreciated.

    Thanks in advance.

  • Create a variable (Attack) set to 0.

    On (attack button) Pressed: Add 1 to Attack

    subevent Attack = 1: Play attackanim1, move player forward (however you want to do this - Custom Movement or something should work)

    subevent Attack = 2: Play attackanim2, move player forward

    subevent Attack = 3: Play attackanim3, move player forward

    You'll want some way to reset attack to zero - either whenever an attack animation finishes or after a specified time, depends how you want to do it.

    I think that should work, you may have to play around a bit to get the results you want! If you want to post a capx I'll have a look.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Cool solution, thanks

  • Been looking for this answer all day. Much appreciated.

  • It would seem that often the simplest solutions are out there begging to be found when you don't look hard enough.

  • lolpaca That's the easiest solution for sure. In my beat em up game I wanted to make that you could punch slightly before the animation was finished so it would look smoother. I made a variable "AttackBusy" that was changed to 1 when you attacked and back to 0 on the final frames of the attack animation. You could only press the attack button or move when AttackBusy was 0. Basically this let the character attack with his weapon again without first putting it back in its seath or going into standing pose.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)