Working FastFeet as food (like jj1)

Version:

1.0

Added on:

19 Feb 2013 20: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.
  1. int DefaultJumpStrength = -10;
  2. int MaxJumpStrength = -20;
  3.  
  4. void onLevelLoad() {
  5.   jjObjectPresets[OBJECT::APPLE].determineCurAnim(ANIM::PICKUPS,33);
  6. }
  7.  
  8. void onPlayer() {
  9.   if (p.food >= 1) {
  10.     p.jumpStrength = p.jumpStrength - 1;
  11.     p.food = 0;
  12.   switch(jjRandom()%2) {
  13.     case 0: jjSamplePriority(SOUND::BUBBA_BUBBABOUNCE1); break;
  14.     case 1: jjSamplePriority(SOUND::BUBBA_BUBBABOUNCE2); break;
  15.     }
  16.   }
  17.   if (p.health == 0) {
  18.     p.jumpStrength = DefaultJumpStrength;
  19.   }
  20.   if (p.jumpStrength < MaxJumpStrength) {
  21.     p.jumpStrength = MaxJumpStrength;
  22.   }
  23. }