Attack Animations and Walking Sounds

0 favourites
  • 15 posts
From the Asset Store
3 pixel charaters with over 8 animations each + animations with a gun
  • Greetings!

    I just recently got myself Construct 2, and have already made some test platforms to get a hand at how things work. Thus I have managed to figure out controls, animations and sounds (to a degree haha).

    But I have encountered some issues while trying things: One is attack animations. I followed a tutorial for making attack animations and, despite following everything from the book, I found that the loop for the attack animation does not stop. I was wondering if someone can make a more better/updated tutorial or some tips to fix this.

    The other is adding footstep sounds for when the character is moving. Again i followed some basic instructions for this, but produced the same results. The sounds do not stop when the character stops. I ask again if someone could give me some tips or a detailed walkthrough on how to fix this.

    Thank you for anyone's time for reading this, and I hope to hear from someone (or anyone) with some useful information!

  • Hi Robaschi,

    First off, welcome to the community!

    Can you provide us a screenshot of the code you're using?

    Cheers,

  • Thank you Indomitus!

    As for the coding, what I been using is very simple stuff, some of which I managed to figure out on my own.

  • Hi Robaschi,

    About the sounds you just need to set up a stop between play times. Here I attached a Capx file as an example, hope it helps.

    Cheers,

  • Thanks so much for the help Indomitus! At the moment I only have the walk cycle sounds down, and thanks to the capx you supplied to me, I followed its instructions and now my character has a seamless walk cycle noise!

    I'll be adding in the attack stuff soon, I'm gonna remake the animations for that, but for now, There's still so much I wanna do, but at the moment getting the hang of Construct 2 is a good way to go.

    Of course since I don't have a high enough reputation yet, I can't share the capx file I have, but oh well. Maybe later!

  • Alright a thing I noticed about the sounds for the attacking animations that's kind of a problem: When you attack, the sounds seem to play very fast.

    For example, the character running sound is at 0.4 seconds for every tick for the system condition, whereas the attack animation has no tick for it to determine how long the sound should play before playing again, so it comes out as one long continuous sound until you let go of the key for the attack.

    So if there is a way to remedy this, that's be greatly appreciated!

  • Hi Robaschi,

    You just need to change the "when the k is down" to "when it's pressed" and add a "trigger once" event at the start of the attack code. Here is the New Capx. Let me know if worked.

    Cheers,

  • Aaah of course! I had a feeling I would need to use the trigger once code to it. Once I get onto my computer I'll look at the capx and tell you the results of my little adventure, haha.

    Again, thanks much for the help!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Okay so here's the code I have now, I had to add the 'On any key released' command (will change it to 'On A released' later, used that for debugging purposes) because for some reason the character would stick on the last frame of the attack animation if I kept holding the button down. I think this is probably because I don't mirror my sprites.

    Now for some reason, the character will not play the attack animation for when they're in the air, I have a unique animation set for that, but for some reason it doesn't play. If there's a way to fix that, let me know, it's probably a simple thing I overlooked.

  • Hello there Robaschi,

    What I see here is that you have some overlapped events, you need to be very careful since Construct 2 reads the code lines in the order as they were written, and sometimes the system replaces similar events for the one that has been created at first.

    Try changing the 11th line to "platform is jumping" instead of "Up arrow is down" and let's see what happens.

    Cheers,

  • You also don't need the "On A key down" in event 9 to 11 since this condition is already tested line 7 and common to all those sub-events.

    You can post the URL to your capx as text that we will copy in the URL bar, That would likely be easy, because twice the screenshots you post actually fail to focus/display the events of where your issue lies (on the first screenshot, the events about moving/stopped are collapsed instead of being expanded unfortunately).

  • Hello there Robaschi,

    What I see here is that you have some overlapped events, you need to be very careful since Construct 2 reads the code lines in the order as they were written, and sometimes the system replaces similar events for the one that has been created at first.

    Try changing the 11th line to "platform is jumping" instead of "Up arrow is down" and let's see what happens.

    Cheers,

    You also don't need the "On A key down" in event 9 to 11 since this condition is already tested line 7 and common to all those sub-events.

    You can post the URL to your capx as text that we will copy in the URL bar, That would likely be easy, because twice the screenshots you post actually fail to focus/display the events of where your issue lies (on the first screenshot, the events about moving/stopped are collapsed instead of being expanded unfortunately)

    I was about to post the capx myself, actually, so that someone can tinker with the commands and events and whatnot.

    And since I still don't have enough reputation, here's a spaced out link.

    ht tps : //www . dropbox . com/s/fi6xrwoqkx50qhq/Test%20Two . capx?dl=0

    Just a note I added some more stuff, such as a ladder climbing sequence. I'm still working on that in the meantime.

  • I noticed this thread has become a little quiet. Understandable since people are prolly busy, I myself have been making many more sprites for the game (I just got Aseprite for this reason ahaha), so more animations for more commands to come!

  • Hello Robaschi,

    Hope this helps:

    Cheers!

  • Hey! So i have been working a bit on my test game for a while, and got some things fixed.

    I have now implemented a wall-jumping mechanism following a tutorial and to my surprise it actually works! Downside: You slide up instead of jumping off when on the left side.

    Sadly this also has made me exceed the limit of what I can do in terms of commands in C2, so sometime on the 1st of October I will have to purchase a license for the full version.

    Until then, here's the latest version of my test game.

    https: // dropbox. com/s/fi6xrwoqkx50qhq/Test%20Two.capx?dl=0

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