Movement: dodge animation

0 favourites
  • 8 posts
From the Asset Store
Keep dodging the falling bricks for as long as possible.
  • Hi everyone,

    I am feeling overwhelmed with movement options, none of which are logically giving me the type of movement I am attempting.

    It seems simple in my head: On button pressed (A), character dodges left, waits for a moment, then returns to the original position.

    The movement would be very similar to the dodge in Mike Tyson's Punch-Out!!.

    Could you help me figure this out? Also, I am not a coder, but would love to understand the logic behind the solution.

    Thank you so much!

    pinkpassion

  • if you export the capx we could take a look.

    You would have to have an idle state, dodge left, and dodge right.

    on Button press 'A' => play animation "DodgeLeft", then wait .3 seconds, then play animation idle

    on Button press 'B' => play animation "DodgeRight", then wait .3 seconds, then play animation idle

  • Yeah, simply draw the sprite "dodging" to the left or right, and use the play animation to fire off anytime they push the dodge button

    You can adjust the collision area of each frame of the sprite on a per frame basis, so adjust it so that its no longer in the middle where they player could still be hit like when he's idle.

  • Thanks for the reply. I don't have anything worth showing, as I'm unable to replicate the movement without jumping from point to point.

    Here's my dilemna more clearly:

    Condition: On button pressed (A)

    1) Move Player with acceleration, speed, then deceleration to a point (e.g.) 200 pixels to the left,

    2) Player stays still for set time,

    3) Player returns with acceleration, speed, then deceleration to default position.

  • You can adjust the collision area of each frame of the sprite on a per frame basis, so adjust it so that its no longer in the middle where they player could still be hit like when he's idle.

    And that's actually a good idea.

    My real difficulty is in getting the character to "slide" left, rather than jump left...

  • Set vector X?

  • Hey! I didn't know about vector!

    Platformer was the 1 control method I had not tried (it contains "Vector" movement).

    To clarify, in case anyone is looking for similar "dodge"-type movement, this appears to be working for me:

    1. Apply Platform behavior to Player sprite (adjust behavior attributes as desired)

    2. Events:

       Condition:

    Keyboard / On A pressed

       Actions:

    / Player / Set Platform vector X to -5000 (e.g.)

    / System / Wait 1 second

    / Player / Set Platform vector X to 5000

    Player dodges (slides smoothly) left, pauses for 1 second, then returns.

    Now I need to figure out how to take away player control during the dodge.

    Thanks everyone!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • For that, there is an action for the platformer behaviors.   I believe it's set controls enabled/disabled.

    So at the beginning of press A you would set platform controls 'Disabled' then wait, let it do everything else, and as the last action in the list, you would set platform controls 'enabled'

    Can't think of the exact naming of it, but go ahead and try it!

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