Working FastFeet as food (like jj1)

Version:

1.0

Added on:

19 Feb 2013 19:18

Tags:

Description:
Replaces any kind of object (change variable OBJECT::APPLE) to fast feet. It will add jump height per taken fast feet to a certain amount of maximum jump height set. This works like the jump upgrade in JJ1.
int DefaultJumpStrength = -10;
int MaxJumpStrength = -20;

void onLevelLoad() {
  jjObjectPresets[OBJECT::APPLE].determineCurAnim(ANIM::PICKUPS,33);
}

void onPlayer() {
  if (p.food >= 1) {
    p.jumpStrength = p.jumpStrength - 1;
    p.food = 0;
  switch(jjRandom()%2) {
    case 0: jjSamplePriority(SOUND::BUBBA_BUBBABOUNCE1); break;
    case 1: jjSamplePriority(SOUND::BUBBA_BUBBABOUNCE2); break;
    }
  }
  if (p.health == 0) {
    p.jumpStrength = DefaultJumpStrength;
  } 
  if (p.jumpStrength < MaxJumpStrength) {
    p.jumpStrength = MaxJumpStrength;
  }
}