home *** CD-ROM | disk | FTP | other *** search
- id = _name.substring(1,2);
- if(id <= _parent.map.multi)
- {
- if(_Y < 0 and _parent.orb + 1 < _parent.orbs)
- {
- _X = (random(36) + 1) * 16 + 24;
- _Y = (random(24) + 1) * 16 + 56;
- w = 0;
- while(w < _root.wall.length)
- {
- if(_X + 24 > _root.wall[w].x and _X - 24 < _root.wall[w].x + _root.wall[w].w)
- {
- if(_root.wall[w].ym == 2 and _Y + 24 > _root.wall[w].y and _Y - 24 < _root.wall[w].y + _root.wall[w].h)
- {
- _Y = -99;
- }
- else if(_root.wall[w].ym < 0 and _Y - 24 < _root.wall[w].y and _Y + 24 > _root.wall[w].y - _root.wall[w].h)
- {
- xds = _X - _root.wall[w].x;
- xpr = xds / _root.wall[w].w;
- yds = _root.wall[w].y - _root.wall[w].h * xpr;
- if(_Y + 24 > yds and _Y - 24 < yds)
- {
- _Y = -99;
- }
- else if(_root.wall[w].x < 24 and _root.wall[w].y - _root.wall[w].h < 56 and _Y <= yds)
- {
- _Y = -99;
- }
- else if(_root.wall[w].x + _root.wall[w].w > 616 and _root.wall[w].y > 456 and _Y >= yds)
- {
- _Y = -99;
- }
- }
- else if(_root.wall[w].ym > 0 and _Y + 24 > _root.wall[w].y and _Y - 24 < _root.wall[w].y + _root.wall[w].h)
- {
- xds = _X - _root.wall[w].x;
- xpr = xds / _root.wall[w].w;
- yds = _root.wall[w].y + _root.wall[w].h * xpr;
- if(_Y + 24 > yds and _Y - 24 < yds)
- {
- _Y = -99;
- }
- else if(_root.wall[w].x < 24 and _root.wall[w].y + _root.wall[w].h > 456 and _Y >= yds)
- {
- _Y = -99;
- }
- else if(_root.wall[w].x + _root.wall[w].w > 616 and _root.wall[w].y - _root.wall[w].h < 56 and _Y <= yds)
- {
- _Y = -99;
- }
- }
- else if(_Y + 24 > _root.wall[w].y and _Y - 24 < _root.wall[w].y)
- {
- _Y = -99;
- }
- }
- w++;
- }
- if(_Y > 0)
- {
- _parent.orb = _parent.orb + 1;
- food.gotoAndStop(_parent.map.orb[_parent.orb]);
- if(food._currentframe == 2)
- {
- points = 350;
- }
- else if(food._currentframe == 3)
- {
- points = 150;
- }
- else if(food._currentframe == 4)
- {
- points = 500;
- }
- else if(food._currentframe == 5)
- {
- points = 100;
- }
- else
- {
- points = 250;
- }
- gotoAndPlay(3);
- }
- }
- else if(_Y > 0)
- {
- p = 1;
- while(p <= _root.players)
- {
- if(_root.player[p].ball[1].x + 12 > _X and _root.player[p].ball[1].x - 12 < _X)
- {
- if(_root.player[p].ball[1].y + 12 > _Y and _root.player[p].ball[1].y - 12 < _Y)
- {
- if(food._currentframe == 2 and _root.player[p].speed < 10)
- {
- if(_root.player[p].speed < 8)
- {
- _root.player[p].speed = 8;
- }
- else if(_root.player[p].speed < 14)
- {
- _root.player[p].speed += 2;
- }
- }
- else if(food._currentframe == 3 and _root.player[p].speed > 2)
- {
- if(_root.player[p].speed > 4)
- {
- _root.player[p].speed = 4;
- }
- else if(_root.player[p].speed > 2)
- {
- _root.player[p].speed -= 2;
- }
- }
- else if(food._currentframe == 4)
- {
- if(_root.players == 1)
- {
- _root.player[p].inverted = 1;
- }
- else
- {
- ipn = 1;
- while(ipn <= _root.players)
- {
- if(ipn != p)
- {
- _root.player[ipn].inverted = 1;
- }
- ipn++;
- }
- }
- }
- else if(food._currentframe == 5)
- {
- _root.player[p].inverted = 0;
- _root.player[p].speed = _root.speed;
- }
- pt = 1;
- while(pt <= 2)
- {
- _root.player[p].ball[_root.player[p].ball.length] = new Object();
- _root.player[p].ball[_root.player[p].ball.length - 1].step = new Array();
- _root.player[p].ball[_root.player[p].ball.length - 1].x = _root.player[p].ball[_root.player[p].ball.length - 2].x;
- _root.player[p].ball[_root.player[p].ball.length - 1].y = _root.player[p].ball[_root.player[p].ball.length - 2].y;
- _root.player[p].ball[_root.player[p].ball.length - 1].dir = _root.player[p].ball[_root.player[p].ball.length - 2].dir;
- _root.player[p].ball[_root.player[p].ball.length - 1].speed = _root.player[p].ball[_root.player[p].ball.length - 2].speed;
- _root.player[p].ball[_root.player[p].ball.length - 1].delay = _root.player[p].ball[_root.player[p].ball.length - 2].delay + 16;
- _root.player[p].ball[_root.player[p].ball.length - 1].clip = "p" + p + "b" + (_root.player[p].ball.length - 1);
- _parent["p" + p + "b" + (_root.player[p].ball.length - 1)]._x = _root.player[p].ball[_root.player[p].ball.length - 1].x;
- _parent["p" + p + "b" + (_root.player[p].ball.length - 1)]._y = _root.player[p].ball[_root.player[p].ball.length - 1].y;
- _parent.pl = p;
- tellTarget(_parent)
- {
- depth++;
- duplicateMovieClip("snakeParts","p" + pl + "b" + (_root.player[pl].ball.length - 1),16384 + (100 + depth));
- }
- paint = new Color(_parent["p" + p + "b" + (_root.player[p].ball.length - 1)]);
- paint.setTransform(_root.player[p].fill[_root.player[p].cstep]);
- _root.player[p].cstep = _root.player[p].cstep + 1;
- if(_root.player[p].cstep > _root.player[p].colors)
- {
- _root.player[p].cstep = 1;
- }
- _root.player[p].life += 120;
- if(_root.player[p].life > 72)
- {
- _root.player[p].life = 720;
- }
- pt++;
- }
- _parent.onorb = _parent.onorb + 1;
- _Y = -99;
- if(_root.players == 1)
- {
- _root.player[1].score += points;
- }
- else
- {
- _root.player[p].vspoints = _root.player[p].vspoints + 1;
- }
- if(_parent.onorb >= _parent.orbs)
- {
- _parent.stop();
- _root.clock = 0;
- _root.readygo.play();
- }
- if(food._currentframe == 4)
- {
- gotoAndPlay(25);
- }
- else
- {
- gotoAndPlay(20);
- }
- }
- }
- p++;
- }
- }
- }
- else
- {
- stop();
- }
-