home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Aventura / the_lost_vikings.swf / scripts / DefineSprite_516_SwitchClass / frame_1 / DoAction.as
Encoding:
Text File  |  2007-03-20  |  1.4 KB  |  59 lines

  1. function Switch_Collide0(target)
  2. {
  3.    if(target.CX2 < this.CX1 || target.CX1 > this.CX2 || target.CY2 < this.CY1 || target.CY1 > this.CY2)
  4.    {
  5.       return 0;
  6.    }
  7.    return 1;
  8. }
  9. function Switch_Loop()
  10. {
  11.    this.Obj_Climb = this.Obj_Climb + 1;
  12.    if(this.Obj_Climb & 3)
  13.    {
  14.       this.cacheCX();
  15.       if(_root.Arrow)
  16.       {
  17.          if(Switch_Collide0(_root.Arrow))
  18.          {
  19.             _root.Arrow.Obj_Flags |= 64;
  20.             if(this == _root.Switch1)
  21.             {
  22.                _root.Barrier1.Obj_Flags |= 64;
  23.                _root.Barrier1._visible = 0;
  24.             }
  25.             if(this == _root.Switch2)
  26.             {
  27.                _root.Barrier2.Obj_Flags |= 64;
  28.                _root.Barrier2._visible = 0;
  29.             }
  30.          }
  31.       }
  32.    }
  33. }
  34. this.setHndlr(1,this.Switch_Loop);
  35. this.gotoAndPlay("Switch_Off_Loop");
  36. _root.KEY_LT = 37;
  37. _root.KEY_RT = 39;
  38. _root.KEY_UP = 38;
  39. _root.KEY_DN = 40;
  40. _root.KEY_A = 65;
  41. _root.KEY_B = 83;
  42. _root.KEY_LB = 81;
  43. _root.KEY_RB = 87;
  44. _root.KEY_CHEAT = 17;
  45. _root.Obj_Flags_ALWAYSRUN = 384;
  46. _root.Obj_Flags_BACKGROUND = 256;
  47. _root.Obj_Flags_MICKEY = 128;
  48. _root.Obj_Flags_DEAD = 64;
  49. _root.Obj_Flags_SPECIAL = 32;
  50. _root.Obj_Flags_KILL = 16;
  51. _root.Obj_Flags_KEYBD = 8;
  52. _root.Obj_Flags_GONE = 4;
  53. _root.Obj_Flags_ATTACK = 2;
  54. _root.Obj_Flags_CLIMBING = 1;
  55. this.Obj_X1 = -10;
  56. this.Obj_X2 = 10;
  57. this.Obj_Y1 = -10;
  58. this.Obj_Y2 = 10;
  59.