View Single Post
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,983

Violet CLM has disabled reputation

Mar 23, 2020, 06: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.)
__________________