home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / astroys.swf / scripts / frame_2 / DoAction.as
Encoding:
Text File  |  2006-06-13  |  1.7 KB  |  74 lines

  1. stop();
  2. clearInterval(beatTimeout);
  3. Key.removeListener(keyListener);
  4. MovieClip.prototype.wrapPos = function()
  5. {
  6.    if(this._x > xMax + this._width / 2)
  7.    {
  8.       if(this._name == "saucer_mc")
  9.       {
  10.          this.hideSaucer();
  11.       }
  12.       else
  13.       {
  14.          this._x -= xMax + this._width;
  15.       }
  16.    }
  17.    if(this._y > yMax + this._height / 2)
  18.    {
  19.       this._y -= yMax + this._height;
  20.    }
  21.    if(this._x < (- this._width) / 2)
  22.    {
  23.       if(this._name == "saucer_mc")
  24.       {
  25.          this.hideSaucer();
  26.       }
  27.       else
  28.       {
  29.          this._x += xMax + this._width;
  30.       }
  31.    }
  32.    if(this._y < (- this._height) / 2)
  33.    {
  34.       this._y += yMax + this._height;
  35.    }
  36. };
  37. introMover = function()
  38. {
  39.    this._x += this.vx;
  40.    this._y += this.vy;
  41.    this.wrapPos();
  42. };
  43. introAsteroids = function()
  44. {
  45.    var i = 10;
  46.    while(i--)
  47.    {
  48.       var angle = Math.random() * 6.283185307179586;
  49.       var s = [100,50,25][i % 3];
  50.       intro_mc.attachMovie("asteroid",i,i,{vx:Math.sin(angle) * 1.5,vy:Math.cos(angle) * 1.5,_x:Math.random() * xMax,_y:Math.random() * yMax,_xscale:s,_yscale:s,onEnterFrame:introMover}).gotoAndStop(i % 4 + 1);
  51.    }
  52. };
  53. game_so = SharedObject.getLocal("neaveAsteroids");
  54. score = 0;
  55. xMax = 500;
  56. yMax = 375;
  57. introAsteroids();
  58. playGame_btn.onRelease = function()
  59. {
  60.    play();
  61. };
  62. highScores_btn.onRelease = function()
  63. {
  64.    getURL("http://www.neodelight.com/highscores?ref=asteroids&ref_loc=highscores&ref_ver=" + _root.version,"_blank");
  65. };
  66. moreGames_btn.onRelease = function()
  67. {
  68.    getURL("http://www.neodelight.com?ref=asteroids&ref_loc=moregames&ref_ver=" + _root.version,"_blank");
  69. };
  70. neave_btn.onRelease = function()
  71. {
  72.    getUrl("http://www.neave.com/games/", "_blank");
  73. };
  74.