View Single Post
Violet CLM

JCF Éminence Grise

Joined: Mar 2001

Posts: 11,047

Violet CLM has disabled reputation

Mar 23, 2020, 07:41 AM
Violet CLM is offline
Reply With Quote
Ah, okay, I see what you mean. Try something like this:
Code:
int SpeedUpUntil = 0;
void onPlayer(jjPLAYER@ play) {
  if (SpeedUpUntil > jjGameTicks) {
    //adjust player's xspeed and such in here
  }
}
Then whenever you want to turn on the speed up effect, in an onObjectHit or whatever, set SpeedUpUntil = jjGameTicks + 10 * 70; where 10 is the number of seconds you want the effect to last.

(if you want to support cooperative, SpeedUpUntil should be an array<int> instead of a int.)
__________________