home *** CD-ROM | disk | FTP | other *** search
- i = 1;
- while(i <= TotalBalls)
- {
- this["P" + i].PrevX = this["P" + i].x;
- this["P" + i].PrevY = this["P" + i].y;
- this["P" + i].x += this["P" + i].Speed * Math.cos(this["P" + i].Dir);
- this["P" + i].y -= this["P" + i].Speed * Math.sin(this["P" + i].Dir);
- if(this["P" + i].Dir > dblPI)
- {
- this["P" + i].Dir -= dblPI;
- }
- if(this["P" + i].Dir < 0)
- {
- this["P" + i].Dir += dblPI;
- }
- Hit = 0;
- if(this["P" + i].y <= 12)
- {
- Hit = 1;
- this["P" + i].y = 12;
- }
- if(this["P" + i].x >= 437)
- {
- Hit = 2;
- this["P" + i].x = 437;
- }
- if(this["P" + i].y >= 428)
- {
- Hit = 3;
- this["P" + i].y = 428;
- }
- if(this["P" + i].x <= 12)
- {
- Hit = 4;
- this["P" + i].x = 12;
- }
- if(Hit == 1 or Hit == 3)
- {
- this["P" + i]._xscale = 120;
- this["P" + i]._yscale = 80;
- }
- if(Hit == 2 or Hit == 4)
- {
- this["P" + i]._xscale = 80;
- this["P" + i]._yscale = 120;
- }
- if(Hit > 0)
- {
- AngleDiff = this["P" + i].Dir - Reflect[Hit];
- this["P" + i].Dir = Reflect[Hit] - AngleDiff;
- }
- if(Hit == 0)
- {
- if(this["P" + i]._xscale > 100)
- {
- this["P" + i]._xscale -= 5;
- }
- if(this["P" + i]._xscale < 100)
- {
- this["P" + i]._xscale += 5;
- }
- if(this["P" + i]._yscale > 100)
- {
- this["P" + i]._yscale -= 5;
- }
- if(this["P" + i]._yscale < 100)
- {
- this["P" + i]._yscale += 5;
- }
- }
- this["P" + i]._x = this["P" + i].x;
- this["P" + i]._y = this["P" + i].y;
- i++;
- }
-