Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. stop();
  2.  
  3. onMouseMove = function(){
  4.     lpion.hlt._y = lpion2.hlt._y = _root._ymouse-300;
  5.     lpoz.hlt._y = lpoz2.hlt._y = 400-_root._xmouse;
  6.     guidex_mc._x = _xmouse;
  7.     guidey_mc._y = _ymouse;
  8. }
  9. var kolor1:String = "0xFF0000";
  10. var kolor2:String = "0xFF0000";
  11.  
  12. function updateWaves() {
  13.     clear();
  14.      
  15.     f = _root.dane_mc.f0.text;
  16.     hb = _root.dane_mc.f1.text;
  17.     hm = _root.dane_mc.f2.text;
  18.    
  19.    
  20.     Ch = 0.8 + (1.1*Math.log(f)-0.7)*hm - 1.56*Math.log(f);
  21.  
  22.     /*if(f > 200){
  23.         Ch = 3.2*Math.pow(Math.log(11.75*hm),2) - 4.97;    
  24.     } else {
  25.         Ch = 8.29*Math.pow(Math.log(1.54*hm),2) - 1.1;
  26.     }*/
  27.    
  28.     a = 69.55 + 26.16*Math.log(f) - 13.82*Math.log(hb) - Ch;
  29.     b = (44.9 - 6.55*Math.log(hb));
  30.     distance = 0;
  31.     pathLoss = 0;
  32.    
  33.     rays = _root.dane_mc.f5.text;
  34.    
  35.     for (z = 0; z < rays; z++) {
  36.         distance = 0;
  37.         pathLoss = 0;
  38.    
  39.         Vx = 1*Math.sin(z*2*Math.PI/rays);
  40.         Vy = -1*Math.cos(z*2*Math.PI/rays);
  41.  
  42.         xCoord = Stage.width / 2;
  43.         yCoord = Stage.height / 2;
  44.  
  45.         moveTo(xCoord,yCoord);
  46.        
  47.         for(i = 0; i < 1000 && pathLoss < 130; i++) {
  48.             lineStyle(_root.dane_mc.f4.text,kolor1,((30-pathLoss)+120)*100/114);
  49.  
  50.             for (var Item in buildings_mc) {
  51.                
  52.                 if (buildings_mc[Item].horizontal_mc.hitTest(xCoord, yCoord, 0)) {
  53.                     Vy *= -1;
  54.                     lineTo(xCoord,yCoord);
  55.                     pathLoss += 10;
  56.                 }
  57.  
  58.                 if (buildings_mc[Item].horizontal1_mc.hitTest(xCoord, yCoord, 0)) {
  59.                     Vy *= -1;
  60.                     lineTo(xCoord,yCoord);
  61.                     pathLoss += 10;
  62.                 }
  63.  
  64.                 if (buildings_mc[Item].vertical_mc.hitTest(xCoord, yCoord, 0)) {
  65.                     Vx *= -1;
  66.                     pathLoss += 10;
  67.                 }
  68.  
  69.                 if (buildings_mc[Item].vertical1_mc.hitTest(xCoord, yCoord, 0)) {
  70.                     Vx *= -1;
  71.                     lineTo(xCoord,yCoord);
  72.                     pathLoss += 10;
  73.                 }
  74.  
  75.             }
  76.            
  77.             distance += Math.sqrt(Math.pow(Vx,2) + Math.pow(Vy,2));
  78.             pathLoss = a + b*Math.log(distance*0.00005);
  79.            
  80.             trace((30-pathLoss));
  81.             xCoord += Vx;
  82.             yCoord += Vy;
  83.             if(i % 10 == 0){
  84.                 lineTo(xCoord,yCoord);
  85.             }
  86.         }
  87.  
  88.     }
  89. }
  90.  
  91. updateWaves();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement