Downloads containing mo4a_4_cutscene.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: Mystery of the Four... chandie Single player 6.6 Download file

File preview

  1. const bool MLLESetupSuccessful = MLLE::Setup(); ///@MLLE-Generated
  2. #include "MLLE-Include-1.5.asc" ///@MLLE-Generated
  3. #pragma require "mo4a_4_cutscene.j2l" ///@MLLE-Generated
  4. void onPlayer(jjPLAYER@ p) {
  5.         p.idle = 100;
  6.         p.keyRun = false;
  7.         p.keyLeft = false;
  8.         p.lightType = LIGHT::NONE;
  9.         p.keyUp = false;
  10.         p.keyDown = false;
  11.         p.keyRight = false;
  12.  
  13.           p.cameraFreeze(0*32, 0*32, false, false);
  14.  
  15. if(p.keyFire)
  16. jjNxt(false, true);
  17.  
  18. if(p.keyJump)
  19. jjNxt(false, true);
  20.  
  21. if(p.keySelect)
  22. jjNxt(false, true);
  23. }
  24.  
  25.  
  26. bool onDrawHealth(jjPLAYER@ p, jjCANVAS@ canvas) {return true;}
  27.  
  28. bool onDrawLives(jjPLAYER@ p, jjCANVAS@ canvas)  {return true;}
  29. bool onDrawScore(jjPLAYER@ p, jjCANVAS@ canvas)  {return true;}
  30. bool onDrawAmmo(jjPLAYER@ p, jjCANVAS@ canvas)   {return true;}
  31.  
  32.  
  33.  
  34.  
  35. void onLevelLoad() {
  36.  
  37.         jjLevelName = ("");
  38.  
  39.         jjObjectPresets[OBJECT::WATERSHIELD].determineCurAnim(ANIM::BILSBOSS, 4);
  40.         jjObjectPresets[OBJECT::WATERSHIELD].scriptedCollisions = true;
  41.  
  42.         jjObjectPresets[OBJECT::FIRESHIELD].determineCurAnim(ANIM::DEVILDEVAN, 8);
  43.         jjObjectPresets[OBJECT::FIRESHIELD].scriptedCollisions = true;
  44.         jjObjectPresets[OBJECT::FIRESHIELD].direction = -1;
  45.  
  46. }
  47.  
  48. jjTEXTAPPEARANCE SignTextAppearance = STRING::NORMAL;
  49. class Sign {
  50.         private int xPos, yPos; //These pixel-based positions will be generated from tile-based positions in the constructor by multiplying by 32
  51.         private string text;
  52.         private uint widthOfText;
  53.         Sign(){} //AngelScript requires any class that appears in any array to have an explicit default constructor, even if it's never called
  54.         Sign(int xTile, int yTile, const string &in t) {
  55.                 xPos = xTile * 32; //Since this is a constant operation, it could strictly be performed in the draw method instead of the constructor, but this way involves fewer multiplication instructions
  56.                 yPos = yTile * 32; //
  57.                 text = t;
  58.                 SignTextAppearance.newline = STRING::SPECIALSIGN; //Causes the drawString method to interpret instances of the \n character as signals to drop down to a new line, similar to the special effect of the @ character in the STRING::SPIN appearance.
  59.                 SignTextAppearance.spacing = -2; //int jjTEXTAPPEARANCE::spacing is new in 5.2, and this particular value is equivalent to prefixing the string with "ยง2". Make sure to check out bool jjTEXTAPPEARANCE::monospace too, though it didn't end up getting used in this level.
  60.                 widthOfText = jjGetStringWidth(text, STRING::SMALL, SignTextAppearance); //Used for determining how large of a dark rectangle should be drawn behind the text. A matching heightOfText value could of course be generated by counting the number of newline characters--for example, "heightOfText = text.split("\n").length * 20;"--but here the rectangles are constant height instead to limit the temptation to ramble on and on.
  61.         }
  62.         void draw(jjCANVAS@ layer, uint8 textIntensity) const { //Because this method will be called from an onDraw method, it's important to have a jjCANVAS@ passed among the arguments.
  63.                 //layer.drawRectangle(xPos, yPos - 16, widthOfText + 8, 55, 0, SPRITE::TRANSLUCENT);
  64.                 layer.drawString(xPos, yPos, text, STRING::SMALL, SignTextAppearance, 0, SPRITE::BLEND_HARDLIGHT, textIntensity);
  65.         }
  66. }
  67. const array<Sign> Signs = {
  68.         Sign(3, 13, "DEVAN: Rabbit's already got three of the Freezers. They are coming!\nBILSY: Don't worry. They won't succeed this time.\nDEVAN: How can you be so sure?\nBILSY: I'll have some... backup, let's say.\n\nHit ||||||||SPACE |or ||||||||JUMP |to visit ||||||||TIBETIUS."),
  69.  
  70.  
  71. };
  72.  
  73. void onDrawLayer4(jjPLAYER@, jjCANVAS@ layer) {
  74.         const uint8 textIntensity = 200 + int(jjSin(jjGameTicks * 16) * 50);
  75.         for (uint signID = 0; signID < Signs.length; ++signID)
  76.                 Signs[signID].draw(layer, textIntensity);
  77.  
  78. }