Need Help With Jump Sustain

This forum is currently in read-only mode.
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • So i'm using an event with a loop to carry out the jump, and it's working out fine, if the key is released the "player" drops to the ground, and all.

    but the part i cannot get right, is making a loop or whatever event for a jump sustain max in order to kill it. i've tried with timer, with count, and with start and max variables.

    obviously i'm doing something wrong and at a loss here.

    basically my stripped down jump loop looks like this (without the particular collision, jump state and gravity checks.):

    + on Key down

         + For "Jump" 0 to 64

              -> set Y to .Y - (256 * (TimeDelta / 64))

    64 is something like my accuracy number

    so what would be the loop to kill the jump, if say i only one the jump to last half a second and then have the player fall?

    my reasoning was to have something more or less like this:

    + on Key down

         -> set global('Jump_timer') = Timer + 500

         + For "Jump" 0 to 64

              + if global('Jump_enable') = 1

              + if global('Jump_timer') =/< Timer

                  ?-> set global('Jump_enable') = 0

              + if global('Jump_enable') = 1

              + if global('Jump_timer') =/> Timer

                  ?-> set Y to .Y - (256 * (TimeDelta / 64))

    but i couldnt get it working,

    help anyone?

    <img src="smileys/smiley4.gif" border="0" align="middle" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)