home *** CD-ROM | disk | FTP | other *** search
/ Champak 108 / jogo-disk-108.iso / Games / steppenwolf_1_chapter_3.swf / scripts / DefineSprite_962 / frame_1 / DoAction.as
Text File  |  2010-05-15  |  5KB  |  109 lines

  1. if(3 < eval("/Variables:InvNb"))
  2. {
  3.    if(_root.Inventaire.ZoneMoveG.hitTest(_root._xmouse,_root._ymouse,true))
  4.    {
  5.       if(eval("/Variables:Acceleration") < 1 and eval("/Variables:Acceleration") >= 0)
  6.       {
  7.          set("/Variables:Acceleration",-1);
  8.       }
  9.       if((_root.Inventaire._xmouse - _root.Inventaire.BorneCentre._x + 20) / 2 < eval("/Variables:Acceleration"))
  10.       {
  11.          if(eval("/Variables:Acceleration") < 0)
  12.          {
  13.             set("/Variables:Acceleration",eval("/Variables:Acceleration") + eval("/Variables:Acceleration") / 2);
  14.          }
  15.          else
  16.          {
  17.             set("/Variables:Acceleration",eval("/Variables:Acceleration") - eval("/Variables:Acceleration") / 2);
  18.          }
  19.       }
  20.       else if(eval("/Variables:Acceleration") < 0)
  21.       {
  22.          set("/Variables:Acceleration",eval("/Variables:Acceleration") - eval("/Variables:Acceleration") / 2);
  23.       }
  24.       else
  25.       {
  26.          set("/Variables:Acceleration",eval("/Variables:Acceleration") + eval("/Variables:Acceleration") / 2);
  27.       }
  28.    }
  29.    else if(_root.Inventaire.ZoneMoveD.hitTest(_root._xmouse,_root._ymouse,true))
  30.    {
  31.       if(-1 < eval("/Variables:Acceleration") and 0 >= eval("/Variables:Acceleration"))
  32.       {
  33.          set("/Variables:Acceleration",1);
  34.       }
  35.       if((_root.Inventaire._xmouse - _root.Inventaire.BorneCentre._x - 20) / 2 < eval("/Variables:Acceleration"))
  36.       {
  37.          if(0 < eval("/Variables:Acceleration"))
  38.          {
  39.             set("/Variables:Acceleration",eval("/Variables:Acceleration") - eval("/Variables:Acceleration") / 2);
  40.          }
  41.          else
  42.          {
  43.             set("/Variables:Acceleration",eval("/Variables:Acceleration") + eval("/Variables:Acceleration") / 2);
  44.          }
  45.       }
  46.       else if(0 < eval("/Variables:Acceleration"))
  47.       {
  48.          set("/Variables:Acceleration",eval("/Variables:Acceleration") + eval("/Variables:Acceleration") / 2);
  49.       }
  50.       else
  51.       {
  52.          set("/Variables:Acceleration",eval("/Variables:Acceleration") - eval("/Variables:Acceleration") / 2);
  53.       }
  54.    }
  55.    else if(1 < eval("/Variables:Acceleration"))
  56.    {
  57.       set("/Variables:Acceleration",eval("/Variables:Acceleration") - eval("/Variables:Acceleration") / 2);
  58.    }
  59.    else if(eval("/Variables:Acceleration") < -1)
  60.    {
  61.       set("/Variables:Acceleration",eval("/Variables:Acceleration") - eval("/Variables:Acceleration") / 2);
  62.    }
  63.    else
  64.    {
  65.       set("/Variables:Acceleration",0);
  66.    }
  67.    if(eval("/Variables:Acceleration") < -20)
  68.    {
  69.       set("/Variables:Acceleration",-20);
  70.    }
  71.    else if(20 < eval("/Variables:Acceleration"))
  72.    {
  73.       set("/Variables:Acceleration",20);
  74.    }
  75.    setProperty("../Chaine1", _X, getProperty("../Chaine1", _X) - eval("/Variables:Acceleration"));
  76.    setProperty("../Chaine2", _X, getProperty("../Chaine2", _X) - eval("/Variables:Acceleration"));
  77.    setProperty("../Chaine3", _X, getProperty("../Chaine3", _X) - eval("/Variables:Acceleration"));
  78.    if(_root.Inventaire.ZoneMoveD.hitTest(_root._xmouse,_root._ymouse,true))
  79.    {
  80.       if(getProperty("../Chaine1", _X) + eval("/Variables:InvNb") * eval("/Variables:LargeurObjet") < getProperty("../BorneGauche", _X))
  81.       {
  82.          setProperty("../Chaine1", _X, getProperty("../Chaine3", _X) + eval("/Variables:InvNb") * eval("/Variables:LargeurObjet"));
  83.       }
  84.       if(getProperty("../Chaine2", _X) + eval("/Variables:InvNb") * eval("/Variables:LargeurObjet") < getProperty("../BorneGauche", _X))
  85.       {
  86.          setProperty("../Chaine2", _X, getProperty("../Chaine1", _X) + eval("/Variables:InvNb") * eval("/Variables:LargeurObjet"));
  87.       }
  88.       if(getProperty("../Chaine3", _X) + eval("/Variables:InvNb") * eval("/Variables:LargeurObjet") < getProperty("../BorneGauche", _X))
  89.       {
  90.          setProperty("../Chaine3", _X, getProperty("../Chaine2", _X) + eval("/Variables:InvNb") * eval("/Variables:LargeurObjet"));
  91.       }
  92.    }
  93.    else
  94.    {
  95.       if(getProperty("../BorneDroite", _X) < getProperty("../Chaine1", _X) - eval("/Variables:InvNb") * eval("/Variables:LargeurObjet"))
  96.       {
  97.          setProperty("../Chaine1", _X, getProperty("../Chaine2", _X) - eval("/Variables:InvNb") * eval("/Variables:LargeurObjet"));
  98.       }
  99.       if(getProperty("../BorneDroite", _X) < getProperty("../Chaine2", _X) - eval("/Variables:InvNb") * eval("/Variables:LargeurObjet"))
  100.       {
  101.          setProperty("../Chaine2", _X, getProperty("../Chaine3", _X) - eval("/Variables:InvNb") * eval("/Variables:LargeurObjet"));
  102.       }
  103.       if(getProperty("../BorneDroite", _X) < getProperty("../Chaine3", _X) - eval("/Variables:InvNb") * eval("/Variables:LargeurObjet"))
  104.       {
  105.          setProperty("../Chaine3", _X, getProperty("../Chaine1", _X) - eval("/Variables:InvNb") * eval("/Variables:LargeurObjet"));
  106.       }
  107.    }
  108. }
  109.