How do I make a 8-directional dash

0 favourites
  • 4 posts
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • Hey everyone,

    I'm making a platformer with some fancy moves and I'm trying to create an aerial dash that could be in every direction possible : D for right, W for up, WD for diagonal up-right... So basically : when you hit the key while in air, the character is pushed in a straight line for a brief moment, then the gravity would be back to normal.

    But right now i'm starting to get mad because I've tried everything, from bullet behavior to some cryptic plugins... The only thing I get is some weird angles movements...

    Could someone give me a lead ? Thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Using the platformer behavior, you could set vector X and vector Y accordingly to the dash direction for a set period of time, cancelling the value of gravity.

  • Yup I've tried this but I think I'm doing it wrong, because it's not working well... I've set it like this (well, other ways too but mostly this one) :

    On Keyboard D is pressed, spacebar is down, platform is jumping

    ---Set "dash" enabled

    On "dash" enabled

    ---Set platform angle to (something) ? I've also tried max fall speed to 0, and some other things, but it's always weird...

    ---Set platform vector X to (something)

    ---Set dash disabled

    Am I forgetting an event or action ?

    Edit : I added a "Wait" action and it seems to be more or less working, but just horizontally. When I'm trying to dash vertically or diagonally it's doing weird stuff.

  • Vector X is only the horizontal movement. Negative it will go left, positive it will go right.

    Vector Y is only the vertical movement. Negative it will go up, positive it will go down.

    In your example, you set the angle (no effect on the movement itself) and move it on the horizontal axis.

    According to the key pressed, you want to set a combination of values for vector X and vector Y (also consider momentum).

    Consider posting your capx.

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