combo

0 favourites
  • 11 posts
From the Asset Store
Combo
$10 USD
Button Combinations like in fightings, supports both keyboard and gamepads
  • <img src="http://neuropod.net/imagehost/uploads/63b34865ab92c9a1e299332aa9cfd580.png" border="0" />

    I'm new to C2 programming. I have been spending hours on this. After I use the 3 hit combo, I can't use even the first attack of the combo again.

    I tried implementing the post of Rory here

    scirra.com/forum/how-do-i-press-double-a-to-double-punch_topic55443_post347045.html

    I don't know what conditions to implement the "wait 1 second" part, but earlier I tried this (instead of the place of "Set Combo to 0" in the screenshot

    Condition:

    system--> time >= 1 sec

    Action:

    Set Combo to 0

    It doesn't work.

    btw, "Combo" is an instance variable of Luffy.

    Luffy is the name of the character.

    My other problem is how to make the character stop moving even if I press the left or right arrows. The "Set Vector X to 0" there in the pic doesn't solve it.

  • If you want to prevent the player moving use the platform 'Set ignoring input' or 'Set Platform disabled' action.

    If you can't do the first attack again that would suggest that Combo isn't being set back to 0. Which would suggest that the animation isn't finishing. Could there be another event that changes the animation before "Combo3" finishes?

  • ok.

    about the animation, no. No other event changes the animation. That's the first 3 attacks I have programmed to the char. I have only movement events aside from those combo attacks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • After tinkering with the combo, I made it to work.

    I want to make a run (separate from Walk) by double tapping right or left arrow, I am applying the same logic from combo. But it doesn't work.

    <img src="http://neuropod.net/imagehost/uploads/a9c598d304f376d961d7a0748aa4ec47.png" border="0" />

    Any tips?

  • you have something weird going on with your "is mirrored". First you check if the sprite is mirrored or not, but then, in the key press condition, you also check if the sprite is mirrored a second time. While in the facing left case it does not really matter, in the facing right it does because you first check that the sprite is not mirrored, then you check if it is, so the second condition will never be true.

    Then something is messed up with the left/right arrows too. In your "facing left group" you check if the right arrow is pressed. Should it be the left arrow?

    then in the "facing right" group, you check if the left arrow is pressed, but if the right arrow is released. There is definitely a mistake here

    finally, the actions in the facing left and right groups are exactly the same. So even if your logic was right, it would not work.

  • Yeah, sorry for the mistakes regarding buttons and mirrored checking. I fixed them.

    <img src="http://neuropod.net/imagehost/uploads/c9a23adabfdacce9389deb973628eed4.png" border="0" />

    But the actions inside both left and right were really intended to be the same since I thought they should do the same thing (run). So what's the correct logic for this situation?

  • Indeed, you don't need to duplicate everything. Actually, the fact that the character is mirrored does not matter, you can remove it. You can make an OR event: drag and drop the left arrow pressed condition inside the right arrow pressed condition. That means you need to press both the left and right keys for the event to be true. Unless you right click on the condition block and select "make OR" and that means the event will be triggered if the right arrow or the left arrow is pressed. But the "is walk animation playing" is also in the OR block, you need to move it out.

    Something like this

    -Right arrow pressed

        OR

    -Left arrow pressed

       -luffy is animation playing ---> put your actions here

    same thing for the arrow release, you can combine both in one OR block

    EDIT: MY bad, forget what I said, you need to know which direction the character is already walking because if you press the right key while you're walking left, it would start running instead of turning around. But still I'm sure it can be optimized. And if you can't get rid of duplicated actions in the end, you should look into the Function plugin

  • I think I understood/followed your instructions, but the Run doesn't work still.

    <img src="http://neuropod.net/imagehost/uploads/22d86d47340b651f0ca9f102b15648b5.png" border="0" />

  • any help? the run still doesn't work

  • when you press the Right Or Left arrow, you are not in the "Pressed" condition. You are in "Key down"

  • Ok. I changed "pressed" to "key is down" for both right and left. Still doesn't work.

    I think I have to change the conditions from detecting if the animation is "Walk" to detecting the double tapping of right or left because the moment after I release my fingers off the first tap, the character isn't in "Walk" animation anymore, that's just my theory why it doesn't work.

    How do I detect a quick double tap?

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