home *** CD-ROM | disk | FTP | other *** search
/ Champak 35 / jogo-disk-35.iso / Games / red_beard.swf / scripts / DefineSprite_131 / frame_1 / DoAction.as
Text File  |  2007-02-27  |  3KB  |  62 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:state") != "dead")
  4.    {
  5.       if(eval("_root.codeMC:colourActive") == "blue" or eval("_root.codeMC:blueSwitch") == "on")
  6.       {
  7.          graphic.gotoAndStop("on");
  8.          range = 10;
  9.          if(getProperty("_root.playerMC", _Y) > _Y + getProperty("_root.BackgroundMC", _Y) - range and getProperty("_root.playerMC", _Y) < _Y + getProperty("_root.BackgroundMC", _Y) + range)
  10.          {
  11.             inRange = "on";
  12.          }
  13.          else
  14.          {
  15.             inrange = "off";
  16.          }
  17.          if(getProperty("_root.playerMC", _Y) < _Y + getProperty("_root.BackgroundMC", _Y) and getProperty("_root.playerMC", _Y) + eval("_root.CodeMC:fallspeed") > _Y + getProperty("_root.BackgroundMC", _Y))
  18.          {
  19.             yCollision = "on";
  20.          }
  21.          else
  22.          {
  23.             yCollision = "off";
  24.          }
  25.          if(getProperty("_root.playerMC", _X) > _X + getProperty("_root.BackgroundMC", _X) and getProperty("_root.playerMC", _X) < _X + _width + getProperty("_root.BackgroundMC", _X))
  26.          {
  27.             xCollision = "on";
  28.          }
  29.          else
  30.          {
  31.             xCollision = "off";
  32.          }
  33.          if(inRange == "on" and xCollision == "on")
  34.          {
  35.             if(collision != "on")
  36.             {
  37.                set("_root.CodeMC:platformActive",eval("_root.CodeMC:platformActive") + 1);
  38.             }
  39.             collision = "on";
  40.             set("_root.CodeMC:currentGround",_Y + getProperty("_root.BackgroundMC", _Y));
  41.             setProperty("_root.playerMC", _Y, _Y + getProperty("_root.BackgroundMC", _Y));
  42.             if(getProperty("_root.playerMC", _Y) > eval("_root.codeMC:scrollPointLower"))
  43.             {
  44.                setProperty("_root.backgroundMC", _Y, getProperty("_root.backgroundMC", _Y) - getProperty("_root.playerMC", _Y) + eval("_root.codeMC:scrollPointLower"));
  45.             }
  46.             if(getProperty("_root.playerMC", _Y) < eval("_root.codeMC:scrollPointUpper"))
  47.             {
  48.                setProperty("_root.backgroundMC", _Y, getProperty("_root.backgroundMC", _Y) - getProperty("_root.playerMC", _Y) + eval("_root.codeMC:scrollPointUpper"));
  49.             }
  50.          }
  51.          else if(collision == "on")
  52.          {
  53.             if(inRange == "off" or xCollision == "off")
  54.             {
  55.                set("_root.CodeMC:platformActive",eval("_root.CodeMC:platformActive") - 1);
  56.                collision = "off";
  57.             }
  58.          }
  59.       }
  60.    }
  61. }
  62.