Preventing Direction Change in Mid-Air

Get help using Construct 2

Post » Tue Jun 25, 2013 6:08 am

Hey, there.

I spent a good hour and a half trying to find a way to prevent a character from changing direction in mid-air after pressing the jump key. None of the things I tried were remotely successful, and I couldn't find anything to really help me in any tutorial or the manual.

If someone has solved this problem or has an idea of how to go about doing it, I would love to hear it.

Thanks so much in advance, guys/gals.
B
6
Posts: 10
Reputation: 846

Post » Tue Jun 25, 2013 6:50 am

You can use "is on floor" event. Invert it and it becomes "is in midair". With this event attached to your input event, that should do the trick.

Does that solve your problem?
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,459

Post » Tue Jun 25, 2013 6:56 am

That solves the first half of the problem; targeting the character when it's off the ground, but I still don't know what to do to keep it moving forward at the pace it was going at when it left the ground.

Since it doesn't stop additional input, I'm afraid it doesn't solve my problem.
B
6
Posts: 10
Reputation: 846

Post » Tue Jun 25, 2013 7:00 am

How about creating a global variable and when the player jump, you store the value of vector x of the player in this global variable? And then when the player is NOT on floor, always set vector x to the value stored in the aforementioned global variable?
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,459

Post » Tue Jun 25, 2013 7:02 am

Hey, that could work. I'll give it a shot here shortly and I'll see how it works. Thanks for your help so far, man!kite2013-06-25 07:03:08
B
6
Posts: 10
Reputation: 846

Post » Tue Jun 25, 2013 7:03 am

And one more thing, you can change the deceleration value of the platform behavior.
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,459


Return to How do I....?

Who is online

Users browsing this forum: BrokenHuman50, Hiddendanger, vegapomme27 and 9 guests