Downloads containing jungletown.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: The Town Pack Slaz Single player 7.7 Download file

File preview

  1. const bool MLLESetupSuccessful = MLLE::Setup(); ///@MLLE-Generated
  2. #include "MLLE-Include-1.6.asc" ///@MLLE-Generated
  3. #pragma require "jungletown-MLLE-Data-1.j2l" ///@MLLE-Generated
  4. #pragma require "jungletown.j2l" ///@MLLE-Generated
  5.  
  6. int blasterOption = 0;
  7. enum blasterOptionEnum {simple, advanced};
  8.  
  9. class NonFood : jjBEHAVIORINTERFACE {
  10.         void onBehave(jjOBJ@ obj) {
  11.                 obj.behave(BEHAVIOR::PICKUP);
  12.         }
  13.         bool onObjectHit(jjOBJ@ obj, jjOBJ@, jjPLAYER@ play, int) {
  14.                 obj.behavior = BEHAVIOR::EXPLOSION2;
  15.                 obj.scriptedCollisions = false;
  16.                 obj.frameID = 0;
  17.                 jjSample(obj.xPos, obj.yPos, SOUND::COMMON_EAT1, 0, 0);
  18.                 return true;
  19.         }
  20. }
  21.  
  22. void onLevelLoad() {
  23.         jjTexturedBGFadePositionY = 0.10;
  24.         jjUseLayer8Speeds = true;
  25.         jjWeapons[WEAPON::BLASTER].infinite = false;
  26.         jjWeapons[WEAPON::BLASTER].maximum = 0;
  27.         blasterOption = simple;
  28.         jjObjectPresets[OBJECT::APPLE].determineCurAnim(ANIM::AMMO,15);
  29.         jjObjectPresets[OBJECT::FASTFEET].determineCurAnim(ANIM::PICKUPS,2);
  30.         jjObjectPresets[OBJECT::FASTFEET].points = 50;
  31.         jjObjectPresets[OBJECT::FASTFEET].scriptedCollisions = true;
  32.         jjObjectPresets[OBJECT::FASTFEET].behavior = NonFood();
  33.         jjObjectPresets[OBJECT::EXTRATIME].determineCurAnim(ANIM::PICKUPS,77);
  34.         jjObjectPresets[OBJECT::EXTRATIME].points = 50;
  35.         jjObjectPresets[OBJECT::EXTRATIME].scriptedCollisions = true;
  36.         jjObjectPresets[OBJECT::EXTRATIME].behavior = NonFood();
  37.         jjObjectPresets[OBJECT::STANDMONKEY].energy = 1;
  38.         jjObjectPresets[OBJECT::MONKEY].energy = 1;
  39.        
  40.         jjPIXELMAP rain(32,32);
  41.         for (uint x = 0; x < rain.width; ++x) {
  42.                 for (uint y = 0; y < rain.height; ++y) {
  43.                 if (x == 16) {
  44.                                 if (y <= 24) rain[x,y] = 75;
  45.                                 else rain[x,y] = 74;
  46.                         } else {
  47.                                 rain[x,y] = 0;
  48.                         }
  49.                 }
  50.         }
  51.        
  52.         jjANIMATION@ anim = jjAnimations[jjAnimSets[ANIM::COMMON].firstAnim + 2];
  53.         for (uint frameID = 0; frameID < anim.frameCount; ++frameID) {
  54.                 jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame + frameID];
  55.                 rain.save(frame);
  56.                 frame.hotSpotX = -frame.width/2;
  57.                 frame.hotSpotY = -frame.height;
  58.         }
  59. }
  60.  
  61. void onLevelReload() {
  62.         jjWeapons[WEAPON::BLASTER].maximum = 0;
  63. }
  64.  
  65. void onMain() {
  66.         jjWeapons[WEAPON::BLASTER].maximum = 1;
  67. }
  68.  
  69. void onPlayer(jjPLAYER@ play) {
  70.         if (play.ammo[WEAPON::BLASTER] != jjWeapons[WEAPON::BLASTER].maximum) {
  71.                 if (play.food == 1) play.ammo[WEAPON::BLASTER] = play.ammo[WEAPON::BLASTER] + 1;
  72.                 play.food = 0;
  73.                 }
  74.         if (play.food >= 1) {
  75.                 play.food = 0;
  76.                 }
  77.        
  78.         for (int i = 0; i < 1024; i++) {
  79.                 jjPARTICLE@ particle = jjParticles[i];
  80.                 if (particle.type == PARTICLE::RAIN) {
  81.                         particle.xSpeed = 0;
  82.                         particle.ySpeed = play.ySpeed < 0? 10 : int(10 + play.ySpeed);
  83.                 }
  84.         }
  85. }
  86.  
  87. int hudWidth = jjSubscreenWidth-20;
  88.  
  89. bool onDrawAmmo(jjPLAYER@ play, jjCANVAS@ canvas) {
  90.         if (play.currWeapon == WEAPON::BLASTER && blasterOption == advanced) {
  91.         if (play.charCurr == CHAR::SPAZ || play.charCurr == CHAR::JAZZ)
  92.                 canvas.drawSprite(jjSubscreenWidth-20, jjSubscreenHeight-25, ANIM::AMMO, play.charCurr == CHAR::SPAZ ? 19 : 18, 3, 0, SPRITE::NORMAL, 0);
  93.         if (jjIsTSF) {
  94.         if (play.charCurr == CHAR::LORI)
  95.                 canvas.drawSprite(jjSubscreenWidth-20, jjSubscreenHeight-25, ANIM::PLUS_AMMO, 6, 2, 0, SPRITE::NORMAL, 0);
  96.                 }
  97.                 return true;
  98.         } else return false;
  99. }