home *** CD-ROM | disk | FTP | other *** search
/ Champak 48 / cdrom_image.iso / Games / bossbash.swf / scripts / DefineSprite_183_game_zelda / frame_1 / DoAction.as
Encoding:
Text File  |  2007-09-28  |  1.1 KB  |  62 lines

  1. function bottlephys(who)
  2. {
  3.    who._y -= who.Yvel;
  4.    if(who._y < who.ground)
  5.    {
  6.       who.Yvel -= 1;
  7.    }
  8.    else
  9.    {
  10.       who._y = who.ground;
  11.    }
  12.    if(who._x > 125 && who._x < 425)
  13.    {
  14.       if(who._y <= 333 && who.onramp1 != true)
  15.       {
  16.          who.ground = 333;
  17.          who.onramp0 = true;
  18.       }
  19.       if(who._x > 200 && who._x < 355)
  20.       {
  21.          if(who._y <= 290)
  22.          {
  23.             who.ground = 290;
  24.             who.onramp1 = true;
  25.          }
  26.       }
  27.       else
  28.       {
  29.          who.ground = 333;
  30.          if(who.onramp1 == true)
  31.          {
  32.             who.jumping = true;
  33.             who.onramp1 = false;
  34.             who.onramp0 = true;
  35.          }
  36.       }
  37.    }
  38.    else
  39.    {
  40.       who.ground = 370;
  41.       if(who.onramp0 == true)
  42.       {
  43.          who.jumping = true;
  44.          who.onramp0 = false;
  45.       }
  46.    }
  47. }
  48. function endPart1()
  49. {
  50.    function()
  51.    {
  52.       bottlephys(this);
  53.    }
  54.    b = this.attachMovie("bottle","bottle",this.getNextHighestDepth());
  55.    b._x = boss._x + 125;
  56.    b._y = boss._y;
  57.    b.Yvel = 0;
  58.    bottlefall.start();
  59.    b;
  60.    "onEnterFrame";
  61. }
  62.