Need Help With Jump Sustain

For questions about using Classic.

Post » Thu Oct 20, 2011 8:25 am

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?

superpowerjoe2011-10-20 08:30:01
Posts: 52
Reputation: 858

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 9 guests