home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Classicos / pepsi_pinball.swf / scripts / DefineSprite_230 / frame_120 / DoAction.as
Encoding:
Text File  |  2006-05-18  |  814 b   |  32 lines

  1. stop();
  2. ball._visible = false;
  3. _root.ball.mode = "rampUp";
  4. _root.ball.pos.x = ball._x + this._x;
  5. _root.ball.pos.y = ball._y + this._y;
  6. _root.ball.vel.x = 0;
  7. _root.ball.vel.y = -18;
  8. this.onEnterFrame = function()
  9. {
  10.    if(_root.ball.pos.x - this._x < -70)
  11.    {
  12.       _root.ball.mode = "table";
  13.       if(_root.debug)
  14.       {
  15.          trace(_root.saloonDoorOpen);
  16.          _root.ball.pos.x = 397;
  17.          _root.ball.pos.y = 304.5;
  18.          _root.ball.vel.x = -8;
  19.          _root.ball.vel.y = -10;
  20.       }
  21.       else
  22.       {
  23.          randomVelx = new Array(-7.6,-6.12,-7);
  24.          var rampExit = random(3);
  25.          trace("rampExit = " + rampExit);
  26.          _root.ball.vel.x = randomVelx[rampExit];
  27.          _root.ball.vel.y = -0.14;
  28.       }
  29.       this.onEnterFrame = undefined;
  30.    }
  31. };
  32.