Downloads containing mo4a.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.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.         p.noFire = (p.currWeapon == WEAPON::BLASTER);
  13.  
  14. if(jjResolutionWidth < 800 || jjResolutionHeight < 600) {
  15.         if(resolution == false)
  16.         {p.showText("@@@@@@@@@@@@@@@@@@@@@Game is functional in@800x600", STRING::MEDIUM);
  17.         resolution = true;}
  18.  
  19.         if(p.keyFire || p.keySelect)
  20.         {p.showText("@@@@@@@@@@@@@@@@@@@@@Game is functional in@800x600", STRING::MEDIUM);}
  21.        
  22.         if(p.keyJump)
  23.         {p.keyJump = false;}
  24. }
  25.  
  26. if(jjResolutionWidth == 800 || jjResolutionHeight == 600) {
  27.  
  28.         if(p.keyFire && jjIsTSF == true)
  29.         jjNxt("mo4a_INTRO", false, true);
  30.  
  31.         if(p.keyFire && jjIsTSF == false)
  32.         jjNxt("mo4a_intro_123",false, true);
  33.  
  34.         if(p.keyJump && jjIsTSF == true)
  35.         jjNxt("mo4a_INTRO", false, true);
  36.  
  37.         if(p.keyJump && jjIsTSF == false)
  38.         jjNxt("mo4a_intro_123",false, true);
  39.  
  40.         if(p.keySelect && jjIsTSF == true)
  41.         jjNxt("mo4a_INTRO", false, true);
  42.  
  43.         if(p.keySelect && jjIsTSF == false)
  44.         jjNxt("mo4a_intro_123",false, true);
  45. }
  46.  
  47. }
  48.  
  49. bool resolution = false;
  50.  
  51. bool onDrawHealth(jjPLAYER@ p, jjCANVAS@ canvas) {return true;}
  52. bool onDrawLives(jjPLAYER@ p, jjCANVAS@ canvas)  {return true;}
  53. bool onDrawScore(jjPLAYER@ p, jjCANVAS@ canvas)  {return true;}
  54. bool onDrawAmmo(jjPLAYER@ p, jjCANVAS@ canvas)   {return true;}
  55.  
  56. void onLevelLoad() {
  57. jjLevelName = ("");
  58. }
  59.  
  60.  
  61. jjTEXTAPPEARANCE SignTextAppearance = STRING::NORMAL;
  62. class Sign {
  63.         private int xPos, yPos; //These pixel-based positions will be generated from tile-based positions in the constructor by multiplying by 32
  64.         private string text;
  65.         private uint widthOfText;
  66.         Sign(){} //AngelScript requires any class that appears in any array to have an explicit default constructor, even if it's never called
  67.         Sign(int xTile, int yTile, const string &in t) {
  68.                 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
  69.                 yPos = yTile * 32; //
  70.                 text = t;
  71.                 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.
  72.                 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.
  73.                 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.
  74.         }
  75.         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.
  76.                 //layer.drawRectangle(xPos, yPos - 16, widthOfText + 8, 55, 0, SPRITE::TRANSLUCENT);
  77.                 layer.drawString(xPos, yPos, text, STRING::SMALL, SignTextAppearance, 0, SPRITE::BLEND_HARDLIGHT, textIntensity);
  78.         }
  79. }
  80. const array<Sign> Signs = {
  81.         Sign(10, 13, "Hit ||||||||SPACE |or ||||||||JUMP |to ||||||||START."),
  82.  
  83. };
  84.  
  85. void onDrawLayer4(jjPLAYER@, jjCANVAS@ layer) {
  86.         const uint8 textIntensity = 200 + int(jjSin(jjGameTicks * 16) * 50);
  87.         for (uint signID = 0; signID < Signs.length; ++signID)
  88.                 Signs[signID].draw(layer, textIntensity);
  89.  
  90. }