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

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