How do I program Yoshi's "flutter jump"

0 favourites
  • 3 posts
  • I'm having trouble programming a bug-free version of Yoshi's "flutter jump". I read a previous "how do I..." post on this subject and it helped me a lot in getting to the stage I'm at, but now I'm stuck. Here is a link of how it should look: I've attached a capx of (a version of) the current code that is causing me problems.

    When you first run the capx and hold down the jump button, the player acts as close to how I would like it to. The problems are with the sine wave behaviour and the y vector. The first problem is that on every subsequent jump the players y position changes sharply to an unexpected position in midair.

    The second problem is that if you release the jump button during the flutter jump phase, the sine wave does not reset to the beginning of the phase as I would expect it to with the action "set sine cycle position to 0".

    The action of "wait 1.3 seconds" is to enable the flutter jump animation to end (and for the player to begin falling) towards the top of the sine wave peak, with the Period set at 2 (as it does during the first instance).

    I have some prior knowledge of programming (particularly in C++/C# and Java) and I know the maths behind sine wave behaviours, but I am very inexperienced when it comes to Construct 2. I have read the manual and tried looking for other posts with regards to sine waves and similar problems but have found nothing of use. Any help or advice would be much appreciated!

  • The sinewave behavior has no place in this mechanic. The solution is actually very simple...

    +Player is NOT on floor

    +Jump button is being pressed

    -Subtract 60*dt from Player.FlutterJump

    +Player.FlutterJump < 0

    +Player.FlutterJump > -60

    -Set Player Y Velocity to Self.Platform.VectorY - Self.FlutterJump

    ...It will probably need some tweaking but you get the idea. It's a simple counter force upwards.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thank you so much! I have already ditched the sine behaviour and I'm doing my best to incorporate your instructions. =D

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)