home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Aventura / asitchintime2.swf / scripts / DefineSprite_181 / frame_2 / DoAction.as
Encoding:
Text File  |  2005-11-09  |  896 b   |  39 lines

  1. if(perso.hitTest(_parent.hitBallon) and !c.persoIsJumping and _parent.hitBallon._y + _parent._parent._y + 60 > perso._y)
  2. {
  3.    switch(pushDir)
  4.    {
  5.       case "left":
  6.          if(Key.isDown(37) and _parent.hitBallon._x < perso._x - _parent._parent._x)
  7.          {
  8.             var goForIt = true;
  9.          }
  10.          else
  11.          {
  12.             var goForIt = false;
  13.          }
  14.          break;
  15.       case "right":
  16.          if(Key.isDown(39) and _parent.hitBallon._x > perso._x - _parent._parent._x)
  17.          {
  18.             var goForIt = true;
  19.          }
  20.          else
  21.          {
  22.             var goForIt = false;
  23.          }
  24.          break;
  25.       default:
  26.          var goForIt = true;
  27.    }
  28.    if(goForIt)
  29.    {
  30.       c.persoXSpeed = 0;
  31.       if(c.persoIsFalling)
  32.       {
  33.          c.persoYSpeed = 0;
  34.          c.persoAnim("land");
  35.       }
  36.       _parent.play();
  37.    }
  38. }
  39.