Dash like on Mega Man X

Get help using Construct 2

Post » Fri Mar 22, 2013 6:30 am

Hey guys,

I would like for my character to dash like on the mega man x games. It looks as if he is done when he completes his dash, but if you press jump soon after he is finished dashing he will jump with all of the momentum of a "dash jump". I can't quite get this.

"WASD" to move and "shift" to dash.

https://www.dropbox.com/s/2h81lhsa2ux8y2v/Test2.capx
B
23
S
6
G
3
Posts: 122
Reputation: 2,922

Post » Fri Mar 22, 2013 8:10 am

Dash jump works perfectly for me. Your code is right, checking to see if "jumping" is playing and if it is, setting platform speed to 600.

I'd just suggest that you check to see if the player is in air before allowing the dash, otherwise he can "jump dash" (not the same as dash jumping) while in the air, which just looks weird.
B
56
S
15
G
10
Posts: 910
Reputation: 11,952

Post » Sat Mar 23, 2013 7:32 am

Perhaps I worded what I am asking incorrectly.

I have no problem with him jumping after dashing and he has all the momentum, which is great. My problem is when he stops his dash and you press jump right after he will perform a dash jump when he shouldn't, because he is actually done with the dash.

Does that clear things up at all?
B
23
S
6
G
3
Posts: 122
Reputation: 2,922

Post » Wed Apr 10, 2013 9:25 pm

Try making an boolean instance variable on your Player object (Sprite) called Dashing, set it to "false".
The logic is something like this:
1) If Player is on the floor and Dashing is false, set (normal acceleration, velocity etc atributes)
2) If Player is on the floor and pressing Dash Button, set Dashing to true.
3) If Dashing is true, set (dash atributes)

There's a lot more to it but this are the basics I believe.siks2013-04-10 21:26:19
B
52
S
10
G
6
Posts: 133
Reputation: 8,715


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, BipolarMike, R0J0hound, totoe and 19 guests