home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Aventura / redbeard.swf / scripts / DefineSprite_169 / frame_1 / DoAction.as
Encoding:
Text File  |  2008-09-12  |  2.5 KB  |  59 lines

  1. if(getProperty("_root.BackgroundMC", _X) + _X + _width > 0 and getProperty("_root.BackgroundMC", _X) + _X < 450 and getProperty("_root.BackgroundMC", _Y) + _Y + _height > 0 and getProperty("_root.BackgroundMC", _Y) + _Y < 300)
  2. {
  3.    if(eval("_root.codeMC:colourActive") == "blue" or eval("_root.codeMC:blueSwitch") == "on")
  4.    {
  5.       graphic.gotoAndStop("on");
  6.       range = 10;
  7.       if(getProperty("_root.playerMC", _Y) > _Y + getProperty("_root.BackgroundMC", _Y) - range and getProperty("_root.playerMC", _Y) < _Y + getProperty("_root.BackgroundMC", _Y) + range)
  8.       {
  9.          inRange = "on";
  10.       }
  11.       else
  12.       {
  13.          inrange = "off";
  14.       }
  15.       if(getProperty("_root.playerMC", _Y) < _Y + getProperty("_root.BackgroundMC", _Y) and getProperty("_root.playerMC", _Y) + eval("_root.CodeMC:fallspeed") > _Y + getProperty("_root.BackgroundMC", _Y))
  16.       {
  17.          yCollision = "on";
  18.       }
  19.       else
  20.       {
  21.          yCollision = "off";
  22.       }
  23.       if(getProperty("_root.playerMC", _X) > _X + getProperty("_root.BackgroundMC", _X) and getProperty("_root.playerMC", _X) < _X + _width + getProperty("_root.BackgroundMC", _X))
  24.       {
  25.          xCollision = "on";
  26.       }
  27.       else
  28.       {
  29.          xCollision = "off";
  30.       }
  31.       if(inRange == "on" and xCollision == "on")
  32.       {
  33.          if(collision != "on")
  34.          {
  35.             set("_root.CodeMC:platformActive",eval("_root.CodeMC:platformActive") + 1);
  36.          }
  37.          collision = "on";
  38.          set("_root.CodeMC:currentGround",_Y + getProperty("_root.BackgroundMC", _Y));
  39.          setProperty("_root.playerMC", _Y, _Y + getProperty("_root.BackgroundMC", _Y));
  40.          if(getProperty("_root.playerMC", _Y) > eval("_root.codeMC:scrollPointLower"))
  41.          {
  42.             setProperty("_root.backgroundMC", _Y, getProperty("_root.backgroundMC", _Y) - getProperty("_root.playerMC", _Y) + eval("_root.codeMC:scrollPointLower"));
  43.          }
  44.          if(getProperty("_root.playerMC", _Y) < eval("_root.codeMC:scrollPointUpper"))
  45.          {
  46.             setProperty("_root.backgroundMC", _Y, getProperty("_root.backgroundMC", _Y) - getProperty("_root.playerMC", _Y) + eval("_root.codeMC:scrollPointUpper"));
  47.          }
  48.       }
  49.       else if(collision == "on")
  50.       {
  51.          if(inRange == "off" or xCollision == "off")
  52.          {
  53.             set("_root.CodeMC:platformActive",eval("_root.CodeMC:platformActive") - 1);
  54.             collision = "off";
  55.          }
  56.       }
  57.    }
  58. }
  59.