How can I make a jump from a fall? (solved)

iamflip

  • Posts: 9
I want to make a platformer game in a similar style to "I Wanna Be The Guy". I find that the Platformer Movement resource pack has very useful behaviors already in place for most of the mechanics.

There's one thing missing though. I want to be able to jump when the player goes off the platform. And I mean fall from a platform, not jumping off a platform (that's a huge difference). For example of what I mean, take a look at this vid at around 5:48.

Currently with the behaviors in place, I can only execute a jump while on the ground, or after jumping once (air jumping). So... how do I approach making a behavior for this? I know that I have to track when a player is falling (using Is Falling?) but not because of a jump (using Is Jumping?), but that's it.

« Last Edit: July 04, 2011, 04:42:24 pm by iamflip »

Greg

  • *
  • Posts: 1259
You can check the Actor level attribute "Is Falling?" and then also check "Is Jumping?" -- if the Actor is falling, but not jumping - you're good to go. 

iamflip

  • Posts: 9
And then just copy off the rest of the jumping behavior? Or just let the jumping behavior do the rest?

Greg

  • *
  • Posts: 1259
And then just copy off the rest of the jumping behavior? Or just let the jumping behavior do the rest?

What you could do is modify the jumping behavior itself such that it checks for either being on ground OR falling and not jumping.  Or you could edit the air jump behavior to eliminate the need to be jumping, and instead just check for falling.

decletro

  • Posts: 235
To the original poster, on "I Wanna Be The Guy", if you are jumping as you exit a scene, you maintain the jump into the next scene. Have you found a way to do this?

Greg

  • *
  • Posts: 1259
To the original poster, on "I Wanna Be The Guy", if you are jumping as you exit a scene, you maintain the jump into the next scene. Have you found a way to do this?

Alexin answered that here -
http://community.stencyl.com/index.php/topic,1790.0.html

You need to keep game attributes that will store the velocity of the Actor prior to the scene change, and then apply that velocity as soon as the new scene starts.

iamflip

  • Posts: 9
Well thanks for the help. I did one tiny adjustment to the Air Jumping behavior, as you said Greg, and it all worked out perfectly.

There's a few other mechanics I still need to figure out, but I'll save those for more threads later. Thanks for the help. :)

Greg

  • *
  • Posts: 1259
No prob - glad you got it working.  Feel free to ask if you run into any other problems or need some advice.