Downloads containing forgor.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: Forgotten LandscapeFeatured Download Dragusela Battle 8 Download file

File preview

  1. const bool MLLESetupSuccessful = MLLE::Setup(); ///@MLLE-Generated
  2. #include "MLLE-Include-1.5.asc" ///@MLLE-Generated
  3. #pragma require "forgor-MLLE-Data-1.j2l" ///@MLLE-Generated
  4. #pragma require "forgor.j2as" ///@MLLE-Generated
  5. void onLevelReload() {
  6.   MLLE::Palette.apply();
  7. }
  8. void onLevelLoad() {
  9.   jjPIXELMAP rain(32,32);
  10.   for (uint x = 0; x < rain.width; ++x) {
  11.     for (uint y = 0; y < rain.height; ++y) {
  12.       if (x == 16) { //draw in the middle of the tile, xPixel 16
  13.         if (y <= 24) rain[x,y] = 75; //if at yPixel 24 or less, use color 75
  14.         else rain[x,y] = 74; //use color 74 for yPixels 25-32
  15.       } else {
  16.         rain[x,y] = 0;
  17.       }
  18.     }
  19.   }
  20.  
  21.   jjANIMATION@ anim = jjAnimations[jjAnimSets[ANIM::COMMON].firstAnim + 2];
  22.   for (uint frameID = 0; frameID < anim.frameCount; ++frameID) {
  23.     jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame + frameID];
  24.     rain.save(frame);
  25.     frame.hotSpotX = -frame.width/2;
  26.     frame.hotSpotY = -frame.height;
  27.   }
  28. }
  29.  
  30. void onPlayer(jjPLAYER@ play) {
  31.   for (int i = 0; i < 1024; i++) { //loop through the global array jjParticles[1024]
  32.     jjPARTICLE@ particle = jjParticles[i];
  33.     if (particle.type == PARTICLE::RAIN) {
  34.       particle.xSpeed = 0; //make rain fall straight down
  35.       particle.ySpeed = play.ySpeed < 0? 10 : int(10 + play.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
  36.     }
  37.   }
  38. }
  39.