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

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