How do I fight mechanics and animation ????

0 favourites
  • 5 posts
From the Asset Store
3 pixel charaters with over 8 animations each + animations with a gun
  • hey there.. i need help in fight animation and mechanic.?

    what i wanna do is that when i press key"L" then it should play "punch animation". but after animation is finished it should get back to its original animation which it was in before which was "idle"

    also i need demo or template if possible..and one more problem i am facing is that when i continuesly press "L" it should start animation and as soon as i leave "L" it should change back to "idle" .. cant use Key down or release , please anyone? or if i get some fighting demo ..?

  • Create a variable for your sprite 'Is Pressed'

    On key pressed 'L' > Set 'Is Pressed' to 1 > Set sprite animation 'punch animation'

    On animation finished 'punch animation' > Set 'Is Pressed' to 0 > set sprite animation 'Idle'

    Make sure your animation is set to not looped.

    Hope it helps

  • thanks man , it worked like a charm.

    also i need one more favor.. how do i do so if i press "L" it plays punch animation, and if i press again it plays different punch animation, and if i press again then again different animation.. i mean to say if i press "L" it should play random selected animations..??? i am new to c2. and working on very complex game. like DMC .. thanks man.. need help

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Give it a variable 'Punch'

    When 'punch animation' is finished > add 1 to 'punch' variable

    When 'punch animation2' is finished > add 1 to 'punch' variable

    When 'punch animation3' is finished > add 1 to 'punch' variable

    if 'punch' variable is 0 > Play 'punch animation 1'

    if 'punch' variable is 1 > Play 'punch animation 2'

    if 'punch' variable is 2 > Play 'punch animation 3'

    if 'punch' variable is 3 > subtract 3 from 'punch' variable

    PUNCH!

  • hey thanks, but can you please do it by adding keyboard example too. and CApx file too thanks ...

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