Fixed Jump Path

Get help using Construct 2

Post » Sun Jan 27, 2013 9:46 pm

Hello, I'm new to Construct. I've been playing around with the jump settings- it seems that the default jump allows the player to control movement in the air ala Mega Man. That's good for a platformer, but I am looking for a way to make a fixed jump path- for example, in a 2D fighting game like street fighter, where up-forward would always give you the same distance/travel path. Is there a way to do that in Construct?

Thank you for any replies/advice :)
B
3
Posts: 3
Reputation: 281

Post » Mon Jan 28, 2013 4:00 am

Try to disable "left" and "right" controls while player in air.
B
13
S
6
G
3
Posts: 20
Reputation: 4,091

Post » Mon Jan 28, 2013 6:00 pm

This only produces a straight up neutral jump- what I'm looking for is..

user presses 'up' - user gets a fixed straight up jump
user presses 'up+right' - user gets a fixed forward jump.

I've been messing with the keyboard events but I cannot find a way to a) assign one action to simultaneous inputs (such as up giving a different action then up+forward) and b) create a fixed path jump that happens every time the inputs are pressed.
B
3
Posts: 3
Reputation: 281

Post » Mon Jan 28, 2013 6:22 pm

Yo! Here's a trick you can try:

Set default controls to 'no' in platform behaviour.

Add a 'simulate control left/right' action that kicks in whenever your player is in the air.
B
22
S
6
G
1
Posts: 398
Reputation: 3,384

Post » Mon Jan 28, 2013 7:51 pm

Getting closer! Here's what I've setup...

default controls set to 'no'

keyboard (on up arrow pressed) player simulate platform pressing jump
keyboard (right arrow is down) player simulate platform pressing right
player set platform acceleration to 1000
player set platform vector X to 1000

now the only problem I have is that multiple up+right inputs increases the distance traveled (effectively repeating the vector x action, i'm guessing). Is there a way to limit this, to where there is only one instance of up+right allowed until player has reached the ground again?
B
3
Posts: 3
Reputation: 281

Post » Mon Jan 28, 2013 8:11 pm

Yes. Create an instance variable for your object named something like "hasjump". Give your jump event a condition that "object.hasjump" = true, and in the jump event set "hasjump" to false. Then use the platform on landing trigger to set "hasjump" to true again.

If you use a number instead of a boolean this is also how you can give characters multiple jumps in a platforming game.Phyvo2013-01-28 20:13:05
B
6
S
1
Posts: 40
Reputation: 917

Post » Mon Jan 28, 2013 11:32 pm

hmmm and what about[code]+On start of layout
   -> player set defaultDeceleration to player.Platform.Deceleration

+player: Platform is on floor
   -> player: stop ignoring Platform user input
   -> player: set Platform deceleration to player.defaultDeceleration

+Player: [invert] Platform is on floor
   -> player: start ignoring Platform user input
   -> player: set platform deceleration to 0[/code]defaultDeceleration being an instance variable of player.Yann2013-01-28 23:32:43
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346


Return to How do I....?

Who is online

Users browsing this forum: MarkThomas, signupdemo, Yahoo [Bot] and 0 guests