How do I make a 8-directional dash

Get help using Construct 2

Post » Tue Jun 21, 2016 4:51 am

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 :D
B
15
S
7
G
2
Posts: 18
Reputation: 2,165

Post » Tue Jun 21, 2016 9:29 am

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.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
296
S
119
G
96
Posts: 7,332
Reputation: 71,306

Post » Tue Jun 21, 2016 11:54 am

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.
B
15
S
7
G
2
Posts: 18
Reputation: 2,165

Post » Tue Jun 21, 2016 1:19 pm

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.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
296
S
119
G
96
Posts: 7,332
Reputation: 71,306


Return to How do I....?

Who is online

Users browsing this forum: corporatedrone, newt and 23 guests