Downloads containing Jellybattle1B.j2as

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

File preview

#include "MLLE-Include-1.3.asc"
const bool MLLESetupSuccessful = MLLE::Setup();
#pragma require "Jellybattle1B-MLLE-Data-1.j2l"

void onLevelBegin() {

	jjUseLayer8Speeds = true;

}

/*****PJ's snippet*****/
void onLevelLoad() {

  jjPIXELMAP rain(32,32);
  for (uint x = 0; x < rain.width; ++x) {
    for (uint y = 0; y < rain.height; ++y) {
      if (x == 16) { //draw in the middle of the tile, xPixel 16
        if (y <= 24) rain[x,y] = 75; //if at yPixel 24 or less, use color 75
        else rain[x,y] = 74; //use color 74 for yPixels 25-32
      } else {
        rain[x,y] = 0;
      }
    }
  }

  jjANIMATION@ anim = jjAnimations[jjAnimSets[ANIM::COMMON].firstAnim + 2];
  for (uint frameID = 0; frameID < anim.frameCount; ++frameID) {
    jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame + frameID];
    rain.save(frame);
    frame.hotSpotX = -frame.width/2;
    frame.hotSpotY = -frame.height;
  }
}
 
void onMain() {
  for (int i = 0; i < 1024; i++) { //loop through the global array jjParticles[1024]
    jjPARTICLE@ particle = jjParticles[i];
    if (particle.type == PARTICLE::RAIN) {
      particle.xSpeed = 0; //make rain fall straight down
      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
    }
  }
}
/**********************/