Downloads containing Jellybattle1B.j2as

Downloads
Name Author Game Mode Rating
JJ2+ Only: Medieval Duels V2 Jelly Jam Battle N/A Download file

File preview

  1. #include "MLLE-Include-1.3.asc"
  2. const bool MLLESetupSuccessful = MLLE::Setup();
  3. #pragma require "Jellybattle1B-MLLE-Data-1.j2l"
  4.  
  5. void onLevelBegin() {
  6.  
  7.         jjUseLayer8Speeds = true;
  8.  
  9. }
  10.  
  11. /*****PJ's snippet*****/
  12. void onLevelLoad() {
  13.  
  14.   jjPIXELMAP rain(32,32);
  15.   for (uint x = 0; x < rain.width; ++x) {
  16.     for (uint y = 0; y < rain.height; ++y) {
  17.       if (x == 16) { //draw in the middle of the tile, xPixel 16
  18.         if (y <= 24) rain[x,y] = 75; //if at yPixel 24 or less, use color 75
  19.         else rain[x,y] = 74; //use color 74 for yPixels 25-32
  20.       } else {
  21.         rain[x,y] = 0;
  22.       }
  23.     }
  24.   }
  25.  
  26.   jjANIMATION@ anim = jjAnimations[jjAnimSets[ANIM::COMMON].firstAnim + 2];
  27.   for (uint frameID = 0; frameID < anim.frameCount; ++frameID) {
  28.     jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame + frameID];
  29.     rain.save(frame);
  30.     frame.hotSpotX = -frame.width/2;
  31.     frame.hotSpotY = -frame.height;
  32.   }
  33. }
  34.  
  35. void onMain() {
  36.   for (int i = 0; i < 1024; i++) { //loop through the global array jjParticles[1024]
  37.     jjPARTICLE@ particle = jjParticles[i];
  38.     if (particle.type == PARTICLE::RAIN) {
  39.       particle.xSpeed = 0; //make rain fall straight down
  40.       particle.ySpeed = jjLocalPlayers[0].ySpeed < 0? 10 : int(10 + jjLocalPlayers[0].ySpeed); //the rain speed accounts for differences in the player speed, and so won't appear to fall more slowly when the player is falling
  41.     }
  42.   }
  43. }
  44. /**********************/