home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / blackknight.swf / scripts / DefineSprite_883 / frame_1 / DoAction.as
Encoding:
Text File  |  2006-06-13  |  1.2 KB  |  58 lines

  1. framesperworld = 7;
  2. moveme = function()
  3. {
  4.    this.x -= this.spd * _root.smult;
  5.    if(this.x < - this._width)
  6.    {
  7.       if(this.other == undefined)
  8.       {
  9.          this.x += 590 + this._width;
  10.       }
  11.       else
  12.       {
  13.          if(this._name == "b1" || this._name == "b2")
  14.          {
  15.             var _loc3_ = (60 - _root.sec) / 60;
  16.             where = (_root.world - 1) * framesperworld + random(framesperworld) + 1;
  17.             this.gotoAndStop(where);
  18.          }
  19.          this.x = this.other.x + this.other._width - this.spd * 2 * _root.smult;
  20.       }
  21.    }
  22.    this._x = Math.floor(this.x);
  23. };
  24. initclip = function(clip, spd, mother)
  25. {
  26.    clip.spd = spd;
  27.    clip.onEnterFrame = moveme;
  28.    clip.other = mother;
  29.    clip.x = clip._x;
  30. };
  31. initclip(g1,5,g2);
  32. initclip(g2,5,g1);
  33. initclip(b1,3,b2);
  34. initclip(b2,3,b1);
  35. b1.gotoAndStop(1);
  36. b2.gotoAndStop(1);
  37. initclip(t1,1);
  38. initclip(t2,1);
  39. initclip(m1,0.5,m2);
  40. initclip(m2,0.5,m1);
  41. k = new Object();
  42. k.onKeyUp = function()
  43. {
  44.    if(Key.getAscii() == 49)
  45.    {
  46.       _root.setgamequality(1);
  47.    }
  48.    else if(Key.getAscii() == 50)
  49.    {
  50.       _root.setgamequality(2);
  51.    }
  52.    else if(Key.getAscii() == 51)
  53.    {
  54.       _root.setgamequality(3);
  55.    }
  56. };
  57. Key.addListener(k);
  58.