home *** CD-ROM | disk | FTP | other *** search
- if(loop == 2)
- {
- loop = 0;
- }
- _parent.pause.gotoAndStop(1);
- loop++;
- _root.clock = 1;
- dead = 0;
- if(_root.readygo.tune == "music1" or _root.readygo.tune == "music2")
- {
- ltune = "music";
- }
- else
- {
- ltune = _root.readygo.tune;
- }
- ltune2 = ltune;
- ltune = "music";
- player = 1;
- while(player <= _root.players)
- {
- if(_root.player[player].speed > 0)
- {
- if(_root.player[player].life < 240)
- {
- ltune = "musicfast";
- }
- else if(_root.player[player].speed > 4 and ltune != "musicfast")
- {
- ltune = "musicfaster";
- }
- if(loop == 2)
- {
- if(player == _root.thisUser)
- {
- if(Key.isDown(37) and _root.player[player].inverted != 1 or Key.isDown(39) and _root.player[player].inverted == 1)
- {
- _root.player[_root.thisUser].ball[1].dir--;
- if(_root.player[_root.thisUser].ball[1].dir < 0)
- {
- _root.player[_root.thisUser].ball[1].dir = 11;
- }
- }
- else if(Key.isDown(39) and _root.player[player].inverted != 1 or Key.isDown(37) and _root.player[player].inverted == 1)
- {
- _root.player[_root.thisUser].ball[1].dir = _root.player[_root.thisUser].ball[1].dir + 1;
- if(_root.player[_root.thisUser].ball[1].dir > 11)
- {
- _root.player[_root.thisUser].ball[1].dir = 0;
- }
- }
- }
- else if(player == _root.nextUser)
- {
- if(Key.isDown(65) and _root.player[player].inverted != 1 or Key.isDown(83) and _root.player[player].inverted == 1)
- {
- _root.player[_root.nextUser].ball[1].dir--;
- if(_root.player[_root.nextUser].ball[1].dir < 0)
- {
- _root.player[_root.nextUser].ball[1].dir = 11;
- }
- }
- else if(Key.isDown(83) and _root.player[player].inverted != 1 or Key.isDown(65) and _root.player[player].inverted == 1)
- {
- _root.player[_root.nextUser].ball[1].dir = _root.player[_root.nextUser].ball[1].dir + 1;
- if(_root.player[_root.nextUser].ball[1].dir > 11)
- {
- _root.player[_root.nextUser].ball[1].dir = 0;
- }
- }
- }
- else if(wait < 45)
- {
- wait++;
- }
- else
- {
- _root.player[player].ball[1].dir--;
- if(_root.player[player].ball[1].dir < 0)
- {
- _root.player[player].ball[1].dir = 11;
- }
- wait -= 3;
- }
- }
- i = 1;
- while(i < _root.player[player].ball.length)
- {
- hp = 1;
- while(hp <= _root.players)
- {
- if(hp != player or i > 2)
- {
- if(_root.player[hp].speed > 0)
- {
- xxd = _root.player[player].ball[i].x - _root.player[hp].ball[1].x;
- xxd *= xxd;
- if(xxd <= 196)
- {
- yyd = _root.player[player].ball[i].y - _root.player[hp].ball[1].y;
- yyd *= yyd;
- if(yyd <= 196)
- {
- xyd = Math.sqrt(yyd + xxd);
- if(xyd <= 15)
- {
- _root.player[hp].speed = 0;
- if(i == 1)
- {
- _root.player[player].speed = 0;
- }
- }
- }
- }
- }
- }
- hp++;
- }
- if(i == 1 and _root.player[player].speed > 0)
- {
- w = 0;
- while(w < _root.wall.length)
- {
- if(_root.player[player].ball[i].x + 12 > _root.wall[w].x and _root.player[player].ball[i].x - 12 < _root.wall[w].x + _root.wall[w].w)
- {
- if(_root.wall[w].ym == 2 and _root.player[player].ball[i].y + 12 > _root.wall[w].y and _root.player[player].ball[i].y - 12 < _root.wall[w].y + _root.wall[w].h)
- {
- _root.player[player].speed = 0;
- }
- else if(_root.wall[w].ym < 0 and _root.player[player].ball[i].y - 12 < _root.wall[w].y and _root.player[player].ball[i].y + 12 > _root.wall[w].y - _root.wall[w].h)
- {
- xds = _root.player[player].ball[i].x - _root.wall[w].x;
- xpr = xds / _root.wall[w].w;
- yds = _root.wall[w].y - _root.wall[w].h * xpr;
- if(_root.player[player].ball[i].y + 12 > yds and _root.player[player].ball[i].y - 12 < yds)
- {
- _root.player[player].speed = 0;
- }
- }
- else if(_root.wall[w].ym > 0 and _root.player[player].ball[i].y + 12 > _root.wall[w].y and _root.player[player].ball[i].y - 12 < _root.wall[w].y + _root.wall[w].h)
- {
- xds = _root.player[player].ball[i].x - _root.wall[w].x;
- xpr = xds / _root.wall[w].w;
- yds = _root.wall[w].y + _root.wall[w].h * xpr;
- if(_root.player[player].ball[i].y + 12 > yds and _root.player[player].ball[i].y - 12 < yds)
- {
- _root.player[player].speed = 0;
- }
- }
- else if(_root.player[player].ball[i].y + 12 > _root.wall[w].y and _root.player[player].ball[i].y - 12 < _root.wall[w].y)
- {
- _root.player[player].speed = 0;
- }
- }
- w++;
- }
- if(_root.player[player].ball[i].x < 22)
- {
- _root.player[player].speed = 0;
- }
- else if(_root.player[player].ball[i].x > 618)
- {
- _root.player[player].speed = 0;
- }
- else if(_root.player[player].ball[i].y < 54)
- {
- _root.player[player].speed = 0;
- }
- else if(_root.player[player].ball[i].y > 458)
- {
- _root.player[player].speed = 0;
- }
- }
- if(i == 1)
- {
- ball = 1;
- }
- else if(i == _root.player[player].ball.length - 1)
- {
- ball = 3;
- }
- else
- {
- ball = 2;
- }
- this[_root.player[player].ball[i].clip].gotoAndStop(ball);
- s = 0;
- while(s < _root.player[player].speed)
- {
- if(i == 1)
- {
- if(_root.player[player].oldspeed != _root.player[player].speed or _root.player[player].olddir != _root.player[player].ball[i].dir)
- {
- _root.player[player].ball[i].speed = _root.player[player].speed;
- _root.player[player].ball[i + 1].step.push({x:_root.player[player].ball[i].x,y:_root.player[player].ball[i].y,dir:_root.player[player].ball[i].dir,speed:_root.player[player].ball[i].speed});
- }
- _root.player[player].oldspeed = _root.player[player].speed;
- _root.player[player].olddir = _root.player[player].ball[i].dir;
- }
- else if(_root.player[player].ball[i].x == _root.player[player].ball[i].step[0].x and _root.player[player].ball[i].y == _root.player[player].ball[i].step[0].y)
- {
- _root.player[player].ball[i].dir = _root.player[player].ball[i].step[0].dir;
- _root.player[player].ball[i].speed = _root.player[player].ball[i].step[0].speed;
- _root.player[player].ball[i].step.shift();
- _root.player[player].ball[i + 1].step.push({x:_root.player[player].ball[i].x,y:_root.player[player].ball[i].y,dir:_root.player[player].ball[i].dir,speed:_root.player[player].ball[i].speed});
- }
- if(_root.player[player].ball[i].dir == 0)
- {
- xm = 0;
- ym = 4;
- }
- else if(_root.player[player].ball[i].dir == 1)
- {
- xm = -2;
- ym = 3.5;
- }
- else if(_root.player[player].ball[i].dir == 2)
- {
- xm = -3.5;
- ym = 2;
- }
- else if(_root.player[player].ball[i].dir == 3)
- {
- xm = -4;
- ym = 0;
- }
- else if(_root.player[player].ball[i].dir == 4)
- {
- xm = -3.5;
- ym = -2;
- }
- else if(_root.player[player].ball[i].dir == 5)
- {
- xm = -2;
- ym = -3.5;
- }
- else if(_root.player[player].ball[i].dir == 6)
- {
- xm = 0;
- ym = -4;
- }
- else if(_root.player[player].ball[i].dir == 7)
- {
- xm = 2;
- ym = -3.5;
- }
- else if(_root.player[player].ball[i].dir == 8)
- {
- xm = 3.5;
- ym = -2;
- }
- else if(_root.player[player].ball[i].dir == 9)
- {
- xm = 4;
- ym = 0;
- }
- else if(_root.player[player].ball[i].dir == 10)
- {
- xm = 3.5;
- ym = 2;
- }
- else if(_root.player[player].ball[i].dir == 11)
- {
- xm = 2;
- ym = 3.5;
- }
- if(_root.player[player].ball[i].delay > 0)
- {
- _root.player[player].ball[i].delay -= 2;
- }
- else
- {
- _root.player[player].ball[i].y += ym / 4 * 2;
- _root.player[player].ball[i].x += xm / 4 * 2;
- }
- s += 2;
- }
- this[_root.player[player].ball[i].clip]._x = _root.player[player].ball[i].x;
- this[_root.player[player].ball[i].clip]._y = _root.player[player].ball[i].y;
- this[_root.player[player].ball[i].clip]._rotation = _root.player[player].ball[i].dir * 30;
- i++;
- }
- }
- else if(_root.player[player].ball.length > 0)
- {
- this[_root.player[player].ball[1].clip].gotoAndStop(4);
- removeMovieClip(_root.player[player].ball[0].clip);
- _root.player[player].ball.shift();
- if(_root.players > 1)
- {
- _root.player[player].vspoints = -1;
- }
- if(playdead != 1)
- {
- _root.readygo.gotoAndPlay("dead");
- playdead = 1;
- }
- }
- else
- {
- _root.player[player].lives--;
- if(_root.players > 1)
- {
- _root.level = _root.level + 1;
- }
- _root.clock = 0;
- stop();
- }
- player++;
- }
- if(ltune != ltune2)
- {
- if(ltune == "music")
- {
- ltune = "music1";
- }
- _root.readygo.tune = ltune;
- _root.readygo.Music.stop();
- _root.readygo.Music.attachSound(ltune);
- _root.readygo.Music.start();
- }
- _root.txt = orbs - onorb + " pills remaining";
-